convert tabs to four spaces

master
melvin 2012-06-16 11:59:08 +08:00
parent 5761959e46
commit 583ad4811f
1 changed files with 38 additions and 37 deletions

View File

@ -18,49 +18,50 @@ import java.util.SortedSet;
public class PermanentPanel extends JPanel implements ChoiceViewer {
private static final long serialVersionUID = 1L;
private final PermanentButton button;
private final List<PermanentButton> linkedButtons;
public PermanentPanel(final PermanentViewerInfo permanentInfo,final GameController controller,final Border border,final int maxWidth) {
private static final long serialVersionUID = 1L;
private final PermanentButton button;
private final List<PermanentButton> linkedButtons;
public PermanentPanel(
final PermanentViewerInfo permanentInfo,
final GameController controller,
final Border border,
final int maxWidth) {
setBorder(FontsAndBorders.SMALL_EMPTY_BORDER);
setLayout(new BorderLayout());
button=new PermanentButton(permanentInfo,controller,border,maxWidth);
add(button,BorderLayout.NORTH);
setBorder(FontsAndBorders.SMALL_EMPTY_BORDER);
setLayout(new BorderLayout());
button=new PermanentButton(permanentInfo,controller,border,maxWidth);
add(button,BorderLayout.NORTH);
linkedButtons=new ArrayList<PermanentButton>();
final SortedSet<PermanentViewerInfo> linked=permanentInfo.linked;
if (!linked.isEmpty()) {
final Color attachedColor=ThemeFactory.getInstance().getCurrentTheme().getColor(Theme.COLOR_SEPARATOR_BACKGROUND);
final Border attachedBorder=BorderFactory.createMatteBorder(0,10,0,0,attachedColor);
final JPanel attachedPanel=new JPanel();
attachedPanel.setLayout(new BoxLayout(attachedPanel,BoxLayout.Y_AXIS));
attachedPanel.setBorder(attachedBorder);
for (final PermanentViewerInfo linkedPermanentInfo : linked) {
linkedButtons=new ArrayList<PermanentButton>();
final SortedSet<PermanentViewerInfo> linked=permanentInfo.linked;
if (!linked.isEmpty()) {
final Color attachedColor=ThemeFactory.getInstance().getCurrentTheme().getColor(Theme.COLOR_SEPARATOR_BACKGROUND);
final Border attachedBorder=BorderFactory.createMatteBorder(0,10,0,0,attachedColor);
final JPanel attachedPanel=new JPanel();
attachedPanel.setLayout(new BoxLayout(attachedPanel,BoxLayout.Y_AXIS));
attachedPanel.setBorder(attachedBorder);
for (final PermanentViewerInfo linkedPermanentInfo : linked) {
final PermanentButton linkedButton=new PermanentButton(
final PermanentButton linkedButton=new PermanentButton(
linkedPermanentInfo,
controller,
BorderFactory.createEmptyBorder(),
maxWidth-10);
linkedButtons.add(linkedButton);
attachedPanel.add(linkedButton);
}
add(attachedPanel,BorderLayout.CENTER);
}
}
linkedButtons.add(linkedButton);
attachedPanel.add(linkedButton);
}
add(attachedPanel,BorderLayout.CENTER);
}
}
@Override
public void showValidChoices(final Set<Object> validChoices) {
button.showValidChoices(validChoices);
for (final PermanentButton linkedButton : linkedButtons) {
linkedButton.showValidChoices(validChoices);
}
}
@Override
public void showValidChoices(final Set<Object> validChoices) {
button.showValidChoices(validChoices);
for (final PermanentButton linkedButton : linkedButtons) {
linkedButton.showValidChoices(validChoices);
}
}
}