Ignore:
Timestamp:
2014-08-04T02:45:06+02:00 (10 years ago)
Author:
donvip
Message:

[josm_plugins] support for unit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysTipsPanel.java

    r28624 r30550  
    99import java.awt.Dimension;
    1010
     11import javax.swing.GroupLayout;
    1112import javax.swing.ImageIcon;
    1213import javax.swing.JCheckBox;
     
    1516import javax.swing.JScrollPane;
    1617import javax.swing.JSeparator;
     18import javax.swing.LayoutStyle;
    1719import javax.swing.ScrollPaneConstants;
    1820import javax.swing.SwingConstants;
    19 
    20 import org.jdesktop.layout.GroupLayout;
    21 import org.jdesktop.layout.LayoutStyle;
    2221
    2322/**
     
    6463        Title.setLayout(TitleLayout);
    6564        TitleLayout.setHorizontalGroup(
    66                 TitleLayout.createParallelGroup(GroupLayout.LEADING)
    67                 .add(GroupLayout.TRAILING, TitleLayout.createSequentialGroup()
    68                         .add(WelcomeTo, GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE)
    69                         .addPreferredGap(LayoutStyle.RELATED)
    70                         .add(Icon, GroupLayout.PREFERRED_SIZE, 132, GroupLayout.PREFERRED_SIZE))
     65                TitleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
     66                .addGroup(GroupLayout.Alignment.TRAILING, TitleLayout.createSequentialGroup()
     67                        .addComponent(WelcomeTo, GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE)
     68                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
     69                        .addComponent(Icon, GroupLayout.PREFERRED_SIZE, 132, GroupLayout.PREFERRED_SIZE))
    7170                );
    7271        TitleLayout.setVerticalGroup(
    73                 TitleLayout.createParallelGroup(GroupLayout.LEADING)
    74                 .add(TitleLayout.createSequentialGroup()
    75                         .add(Icon)
     72                TitleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
     73                .addGroup(TitleLayout.createSequentialGroup()
     74                        .addComponent(Icon)
    7675                        .addContainerGap())
    77                         .add(WelcomeTo, GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE)
     76                        .addComponent(WelcomeTo, GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE)
    7877                );
    7978
     
    110109        steps.setLayout(stepsLayout);
    111110        stepsLayout.setHorizontalGroup(
    112                 stepsLayout.createParallelGroup(GroupLayout.LEADING)
    113                 .add(stepsLayout.createSequentialGroup()
    114                         .addContainerGap()
    115                         .add(stepsLayout.createParallelGroup(GroupLayout.TRAILING)
    116                                 .add(GroupLayout.LEADING, lastHint, 0, 0, Short.MAX_VALUE)
    117                                 .add(GroupLayout.LEADING, step04, 0, 0, Short.MAX_VALUE)
    118                                 .add(GroupLayout.LEADING, step03, 0, 0, Short.MAX_VALUE)
    119                                 .add(GroupLayout.LEADING, step02, 0, 0, Short.MAX_VALUE)
    120                                 .add(GroupLayout.LEADING, step01, GroupLayout.DEFAULT_SIZE, 496, Short.MAX_VALUE))
    121                                 .add(18, 18, 18))
     111                stepsLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
     112                .addGroup(stepsLayout.createSequentialGroup()
     113                        .addContainerGap()
     114                        .addGroup(stepsLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
     115                                .addComponent(lastHint, GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
     116                                .addComponent(step04, GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
     117                                .addComponent(step03, GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
     118                                .addComponent(step02, GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
     119                                .addComponent(step01, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 496, Short.MAX_VALUE))
     120                                .addGap(18, 18, 18))
    122121                );
    123122        stepsLayout.setVerticalGroup(
    124                 stepsLayout.createParallelGroup(GroupLayout.LEADING)
    125                 .add(stepsLayout.createSequentialGroup()
    126                         .add(step01, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
    127                         .addPreferredGap(LayoutStyle.RELATED)
    128                         .add(step02, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
    129                         .addPreferredGap(LayoutStyle.RELATED)
    130                         .add(step03, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
    131                         .addPreferredGap(LayoutStyle.RELATED)
    132                         .add(step04, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
    133                         .addPreferredGap(LayoutStyle.RELATED)
    134                         .add(lastHint, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
     123                stepsLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
     124                .addGroup(stepsLayout.createSequentialGroup()
     125                        .addComponent(step01, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
     126                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
     127                        .addComponent(step02, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
     128                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
     129                        .addComponent(step03, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
     130                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
     131                        .addComponent(step04, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
     132                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
     133                        .addComponent(lastHint, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
    135134                        .addContainerGap(22, Short.MAX_VALUE))
    136135                );
     
    143142        Intro.setLayout(IntroLayout);
    144143        IntroLayout.setHorizontalGroup(
    145                 IntroLayout.createParallelGroup(GroupLayout.LEADING)
    146                 .add(IntroLayout.createSequentialGroup()
    147                         .addContainerGap()
    148                         .add(dontShow, GroupLayout.PREFERRED_SIZE, 245, GroupLayout.PREFERRED_SIZE)
     144                IntroLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
     145                .addGroup(IntroLayout.createSequentialGroup()
     146                        .addContainerGap()
     147                        .addComponent(dontShow, GroupLayout.PREFERRED_SIZE, 245, GroupLayout.PREFERRED_SIZE)
    149148                        .addContainerGap(283, Short.MAX_VALUE))
    150                         .add(scrollableSteps, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
    151                         .add(introText, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
     149                        .addComponent(scrollableSteps, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
     150                        .addComponent(introText, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
    152151                );
    153152        IntroLayout.setVerticalGroup(
    154                 IntroLayout.createParallelGroup(GroupLayout.LEADING)
    155                 .add(GroupLayout.TRAILING, IntroLayout.createSequentialGroup()
    156                         .add(introText, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
    157                         .addPreferredGap(LayoutStyle.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    158                         .add(scrollableSteps, GroupLayout.PREFERRED_SIZE, 209, GroupLayout.PREFERRED_SIZE)
    159                         .addPreferredGap(LayoutStyle.UNRELATED)
    160                         .add(dontShow)
     153                IntroLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
     154                .addGroup(GroupLayout.Alignment.TRAILING, IntroLayout.createSequentialGroup()
     155                        .addComponent(introText, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
     156                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
     157                        .addComponent(scrollableSteps, GroupLayout.PREFERRED_SIZE, 209, GroupLayout.PREFERRED_SIZE)
     158                        .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
     159                        .addComponent(dontShow)
    161160                        .addContainerGap())
    162161                );
     
    165164        this.setLayout(layout);
    166165        layout.setHorizontalGroup(
    167                 layout.createParallelGroup(GroupLayout.LEADING)
    168                 .add(GroupLayout.TRAILING, layout.createSequentialGroup()
    169                         .addContainerGap()
    170                         .add(layout.createParallelGroup(GroupLayout.TRAILING)
    171                                 .add(GroupLayout.LEADING, separator, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
    172                                 .add(Title, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    173                                 .add(Intro, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
     166                layout.createParallelGroup(GroupLayout.Alignment.LEADING)
     167                .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
     168                        .addContainerGap()
     169                        .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
     170                                .addComponent(separator, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
     171                                .addComponent(Title, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
     172                                .addComponent(Intro, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    174173                                .addContainerGap())
    175174                );
    176175        layout.setVerticalGroup(
    177                 layout.createParallelGroup(GroupLayout.LEADING)
    178                 .add(layout.createSequentialGroup()
    179                         .addContainerGap()
    180                         .add(Title, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
    181                         .addPreferredGap(LayoutStyle.UNRELATED)
    182                         .add(separator, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
    183                         .addPreferredGap(LayoutStyle.RELATED)
    184                         .add(Intro, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
     176                layout.createParallelGroup(GroupLayout.Alignment.LEADING)
     177                .addGroup(layout.createSequentialGroup()
     178                        .addContainerGap()
     179                        .addComponent(Title, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
     180                        .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
     181                        .addComponent(separator, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
     182                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
     183                        .addComponent(Intro, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
    185184                        .addContainerGap(45, Short.MAX_VALUE))
    186185                );
     
    206205        return dontShow.isSelected();
    207206    }
    208 
    209207}
Note: See TracChangeset for help on using the changeset viewer.