Revision 42243
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.swing/org.gvsig.symbology.swing.api/src/main/java/org/gvsig/app/gui/styling/SymbolLevelsWindow.java | ||
---|---|---|
73 | 73 |
import org.gvsig.gui.beans.swing.cellrenderers.NumberTableCellRenderer; |
74 | 74 |
import org.gvsig.i18n.Messages; |
75 | 75 |
|
76 |
import org.apache.commons.lang3.StringUtils; |
|
76 | 77 |
|
78 |
|
|
77 | 79 |
/** |
78 | 80 |
* Creates a panel to specify an order for the symbols of a map. This order |
79 | 81 |
* is important when the map is going to be painted because, apart from that |
... | ... | |
100 | 102 |
private static final int ADVANCED_VIEW = 1; |
101 | 103 |
private static int viewMode = ADVANCED_VIEW; |
102 | 104 |
private JCheckBox chkSpecifyDrawOrder = null; |
105 |
private JPanel pnlNorth; |
|
103 | 106 |
private JPanel pnlCenter = null; |
104 | 107 |
private JScrollPane srclLevels = null; |
105 | 108 |
private JTable tblLevels = null; |
... | ... | |
124 | 127 |
} |
125 | 128 |
}; |
126 | 129 |
|
130 |
public SymbolLevelsWindow(ZSort zSort) { |
|
131 |
super(); |
|
132 |
initialize(); |
|
133 |
setModel(zSort); |
|
134 |
quitaEsteMetodo(); |
|
135 |
tblLevels.setRowHeight(23); |
|
136 |
} |
|
137 |
|
|
138 |
private void quitaEsteMetodo() { |
|
139 |
getBtnSwitchView().setEnabled(false); |
|
140 |
getBtnDown().setEnabled(false); |
|
141 |
getBtnUp().setEnabled(false); |
|
142 |
} |
|
143 |
|
|
127 | 144 |
public WindowInfo getWindowInfo() { |
128 | 145 |
WindowInfo wi = new WindowInfo(WindowInfo.RESIZABLE | WindowInfo.MODALDIALOG); |
129 | 146 |
wi.setTitle(Messages.getText("symbol_levels")); |
... | ... | |
211 | 228 |
zSort.setUsingZSort(getChkSpecifyDrawOrder().isSelected()); |
212 | 229 |
} |
213 | 230 |
|
214 |
public SymbolLevelsWindow(ZSort zSort) { |
|
215 |
super(); |
|
216 |
initialize(); |
|
217 |
setModel(zSort); |
|
218 |
quitaEsteMetodo(); |
|
219 |
tblLevels.setRowHeight(23); |
|
220 |
} |
|
221 |
private void quitaEsteMetodo() { |
|
222 |
getBtnSwitchView().setEnabled(false); |
|
223 |
getBtnDown().setEnabled(false); |
|
224 |
getBtnUp().setEnabled(false); |
|
225 |
} |
|
226 | 231 |
/** |
227 | 232 |
* Sets the model |
228 | 233 |
* @param plan ZSort |
... | ... | |
233 | 238 |
+plan.getTopLevelIndexAllowed() ]; |
234 | 239 |
advancedHeaders[SYMBOL_COLUMN_INDEX] = defaultHeaders[SYMBOL_COLUMN_INDEX]; |
235 | 240 |
advancedHeaders[DESCRIPTION_COLUMN_INDEX] = defaultHeaders[DESCRIPTION_COLUMN_INDEX]; |
236 |
for (int i = 2; i < advancedHeaders.length; i++) { |
|
237 |
advancedHeaders[i] = String.valueOf(i-1); |
|
241 |
if (advancedHeaders.length == 3) { |
|
242 |
advancedHeaders[2] = Messages.getText("level"); |
|
243 |
} else { |
|
244 |
for (int i = 2; i < advancedHeaders.length; i++) { |
|
245 |
advancedHeaders[i] = StringUtils.replace(Messages.getText("symbol_level"), "%(level)", String.valueOf(i-1)); |
|
246 |
} |
|
238 | 247 |
} |
239 | 248 |
this.zSort = plan; |
240 | 249 |
getChkSpecifyDrawOrder().setSelected(plan.isUsingZSort()); |
... | ... | |
386 | 395 |
this.setLayout(new BorderLayout(15, 15)); |
387 | 396 |
this.setSize(564, 344); |
388 | 397 |
|
389 |
this.add(getChkSpecifyDrawOrder(), BorderLayout.NORTH);
|
|
390 |
this.add(new JBlank(20, 20)); |
|
398 |
this.add(getNorthPanel(), BorderLayout.NORTH);
|
|
399 |
// this.add(new JBlank(20, 20));
|
|
391 | 400 |
this.add(getPnlCenter(), BorderLayout.CENTER); |
392 | 401 |
this.add(getPnlSouth(), BorderLayout.SOUTH); |
393 | 402 |
tblLevels.addMouseListener(new MouseListener() { |
... | ... | |
436 | 445 |
}); |
437 | 446 |
|
438 | 447 |
} |
448 |
|
|
449 |
private JPanel getNorthPanel() { |
|
450 |
if (pnlNorth == null) { |
|
451 |
pnlNorth = new JPanel(); |
|
452 |
pnlNorth.setLayout(new BorderLayout()); |
|
453 |
pnlNorth.add(new JBlank(15, 15), BorderLayout.NORTH); |
|
454 |
pnlNorth.add(getChkSpecifyDrawOrder(), BorderLayout.CENTER); |
|
455 |
pnlNorth.add(new JBlank(15, 0), BorderLayout.WEST); |
|
456 |
} |
|
457 |
return pnlNorth; |
|
458 |
} |
|
439 | 459 |
|
440 | 460 |
private JCheckBox getChkSpecifyDrawOrder() { |
441 | 461 |
if (chkSpecifyDrawOrder == null) { |
... | ... | |
454 | 474 |
pnlCenter.setLayout(new BorderLayout(0, 15)); |
455 | 475 |
pnlCenter.add(getSrclLevels(), BorderLayout.CENTER); |
456 | 476 |
pnlCenter.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)); |
457 |
JPanel aux = new JPanel(new FlowLayout(FlowLayout.CENTER, 15, 15)); |
|
458 |
JPanel pnlButtons = new JPanel(); |
|
459 |
pnlButtons.setLayout(new BoxLayout(pnlButtons, BoxLayout.Y_AXIS)); |
|
460 |
pnlButtons.add(new JBlank(1, 70)); |
|
461 |
pnlButtons.add(getBtnUp()); |
|
462 |
pnlButtons.add(new JBlank(1, 10)); |
|
463 |
pnlButtons.add(getBtnDown()); |
|
464 |
pnlButtons.setVisible(false); |
|
465 |
aux.add(pnlButtons); |
|
466 |
pnlCenter.add(aux, BorderLayout.EAST); |
|
477 |
// JPanel aux = new JPanel(new FlowLayout(FlowLayout.CENTER, 15, 15));
|
|
478 |
// JPanel pnlButtons = new JPanel();
|
|
479 |
// pnlButtons.setLayout(new BoxLayout(pnlButtons, BoxLayout.Y_AXIS));
|
|
480 |
// pnlButtons.add(new JBlank(1, 70));
|
|
481 |
// pnlButtons.add(getBtnUp());
|
|
482 |
// pnlButtons.add(new JBlank(1, 10));
|
|
483 |
// pnlButtons.add(getBtnDown());
|
|
484 |
// pnlButtons.setVisible(false);
|
|
485 |
// aux.add(pnlButtons);
|
|
486 |
// pnlCenter.add(aux, BorderLayout.EAST);
|
|
467 | 487 |
|
468 | 488 |
} |
469 | 489 |
pnlCenter.setEnabled(getChkSpecifyDrawOrder().isSelected()); |
... | ... | |
519 | 539 |
if (pnlSouth == null) { |
520 | 540 |
pnlSouth = new JPanel(new BorderLayout()); |
521 | 541 |
JPanel aux = new JPanel(); |
522 |
aux.setLayout(new FlowLayout(FlowLayout.RIGHT)); |
|
523 |
aux.add(getBtnSwitchView()); |
|
524 |
pnlSouth.add(aux, BorderLayout.NORTH); |
|
542 |
// aux.setLayout(new FlowLayout(FlowLayout.RIGHT));
|
|
543 |
// aux.add(getBtnSwitchView());
|
|
544 |
// pnlSouth.add(aux, BorderLayout.NORTH);
|
|
525 | 545 |
|
526 | 546 |
aux = new JPanel(); |
527 | 547 |
aux.setLayout(new FlowLayout(FlowLayout.RIGHT)); |
528 |
pnlSouth.add(new AcceptCancelPanel(action, action), BorderLayout.SOUTH);
|
|
548 |
pnlSouth.add(new AcceptCancelPanel(action, action)); |
|
529 | 549 |
|
530 | 550 |
} |
531 | 551 |
return pnlSouth; |
Also available in: Unified diff