107 |
107 |
|
108 |
108 |
|
109 |
109 |
public class FPanelLegendDefault extends JPanel implements ILegendPanel {
|
110 |
|
|
|
110 |
|
111 |
111 |
private FSymbol m_FSymbol = null;
|
112 |
112 |
// private boolean bDisableUpdateControls = true;
|
113 |
|
|
114 |
|
|
|
113 |
|
|
114 |
|
115 |
115 |
protected static final int SLIDER_TEXT_FIELD_COLUMNS = 3;
|
116 |
116 |
// private Paint[] fillPatterns = new FillPatternFactory().createFillPatterns();
|
117 |
117 |
private JPanel centerPanel = new JPanel();
|
... | ... | |
128 |
128 |
protected JCheckBox synchronizeCheckBox = new JCheckBox();
|
129 |
129 |
private JCheckBox linePatternCheckBox = new JCheckBox();
|
130 |
130 |
private JCheckBox fillPatternCheckBox = new JCheckBox();
|
131 |
|
private Paint[] fillPatterns = FSymbolFactory.createPatternFills(Color.GRAY);
|
|
131 |
private Paint[] fillPatterns = FSymbolFactory.createPatternFills(Color.GRAY);
|
132 |
132 |
private String[] linePatterns = new String[] {
|
133 |
133 |
"1", "3", "5", "5,1", "7", "7,12", "9", "9,2", "15,6", "20,3"
|
134 |
134 |
};
|
135 |
|
|
|
135 |
|
136 |
136 |
private Integer[] pointTypes = new Integer[] {
|
137 |
137 |
new Integer(FStyle2D.SYMBOL_STYLE_MARKER_SQUARE),
|
138 |
138 |
new Integer(FStyle2D.SYMBOL_STYLE_MARKER_CIRCLE),
|
... | ... | |
140 |
140 |
new Integer(FStyle2D.SYMBOL_STYLE_MARKER_CROSS),
|
141 |
141 |
new Integer(FStyle2D.SYMBOL_STYLE_MARKER_IMAGEN)
|
142 |
142 |
};
|
143 |
|
|
|
143 |
|
144 |
144 |
protected String pointTypeToString(Integer pointType)
|
145 |
145 |
{
|
146 |
146 |
String resul = "No reconocido";
|
... | ... | |
161 |
161 |
case FStyle2D.SYMBOL_STYLE_MARKER_IMAGEN:
|
162 |
162 |
resul = "Imagen";
|
163 |
163 |
break;
|
164 |
|
|
|
164 |
|
165 |
165 |
}
|
166 |
166 |
return resul;
|
167 |
167 |
}
|
... | ... | |
179 |
179 |
return new Integer(FStyle2D.SYMBOL_STYLE_MARKER_IMAGEN);
|
180 |
180 |
return new Integer(-1);
|
181 |
181 |
}
|
182 |
|
|
|
182 |
|
183 |
183 |
/**
|
184 |
184 |
* Esta funci?n traduce el FSymbol.getStyle() al correspondiente ?ndice
|
185 |
185 |
* dentro del combobox
|
... | ... | |
189 |
189 |
private int fillTypeToInt(int fillType)
|
190 |
190 |
{
|
191 |
191 |
return (fillType - 3);
|
192 |
|
}
|
193 |
|
|
|
192 |
}
|
|
193 |
|
194 |
194 |
private JComboBox pointTypeComboBox = new JComboBox(pointTypes) {
|
195 |
195 |
|
196 |
196 |
{
|
197 |
197 |
BasicComboBoxEditor editor1 = new BasicComboBoxEditor();
|
198 |
|
|
|
198 |
|
199 |
199 |
setEditor(editor1);
|
200 |
200 |
setEditable(true);
|
201 |
201 |
addActionListener(new ActionListener() {
|
... | ... | |
217 |
217 |
jLblImagen.setVisible(false);
|
218 |
218 |
jTxtImagen.setVisible(false);
|
219 |
219 |
}
|
220 |
|
|
221 |
|
|
|
220 |
|
|
221 |
|
222 |
222 |
updateControls(false);
|
223 |
223 |
}
|
224 |
224 |
}
|
... | ... | |
235 |
235 |
AffineTransform mT = new AffineTransform();
|
236 |
236 |
mT.setToIdentity();
|
237 |
237 |
|
238 |
|
FPoint2D shp = new FPoint2D(panel.getWidth()/2,
|
|
238 |
FPoint2D shp = new FPoint2D(panel.getWidth()/2,
|
239 |
239 |
panel.getHeight()/2);
|
240 |
240 |
if (m_FSymbol !=null){
|
241 |
241 |
myFSymbol.setColor(m_FSymbol.getColor());
|
... | ... | |
243 |
243 |
}
|
244 |
244 |
}
|
245 |
245 |
};
|
246 |
|
|
247 |
246 |
|
|
247 |
|
248 |
248 |
public Component getListCellRendererComponent(
|
249 |
249 |
JList list, Object value, int index,
|
250 |
250 |
boolean isSelected, boolean cellHasFocus) {
|
251 |
251 |
pointType = (Integer) value;
|
252 |
252 |
myFSymbol.setStyle(pointType.intValue());
|
253 |
253 |
// Le hacemos que se dibuje siempre con 10 pixels
|
254 |
|
|
|
254 |
|
255 |
255 |
myFSymbol.setSizeInPixels(true);
|
256 |
256 |
myFSymbol.setSize(10);
|
257 |
257 |
myFSymbol.setStroke(new BasicStroke());
|
... | ... | |
261 |
261 |
panel.setBackground(UIManager.getColor(isSelected
|
262 |
262 |
? "ComboBox.selectionBackground"
|
263 |
263 |
: "ComboBox.background"));
|
264 |
|
|
|
264 |
|
265 |
265 |
return panel;
|
266 |
266 |
}
|
267 |
267 |
});
|
268 |
268 |
}
|
269 |
269 |
};
|
270 |
|
|
271 |
|
|
|
270 |
|
|
271 |
|
272 |
272 |
protected JSlider lineWidthSlider = new JSlider() {
|
273 |
273 |
|
274 |
274 |
{
|
... | ... | |
279 |
279 |
});
|
280 |
280 |
}
|
281 |
281 |
};
|
282 |
|
private JComboBox linePatternComboBox = new JComboBox(linePatterns) {
|
|
282 |
private JComboBox linePatternComboBox = new JComboBox(linePatterns) {
|
283 |
283 |
{
|
284 |
284 |
BasicComboBoxEditor editor = new BasicComboBoxEditor();
|
285 |
285 |
setEditor(editor);
|
... | ... | |
365 |
365 |
boolean isSelected, boolean cellHasFocus) {
|
366 |
366 |
fillPattern = (Paint) value;
|
367 |
367 |
// label.setText("" +(1 +
|
368 |
|
// CollectionUtil.indexOf(fillPattern, fillPatterns)));
|
|
368 |
// CollectionUtil.indexOf(fillPattern, fillPatterns)));
|
369 |
369 |
label.setForeground(UIManager.getColor(isSelected
|
370 |
370 |
? "ComboBox.selectionForeground"
|
371 |
371 |
: "ComboBox.foreground"));
|
... | ... | |
383 |
383 |
return fillPatternComboBox;
|
384 |
384 |
}
|
385 |
385 |
//private JComboBox fillPatternComboBox = getFillPatternComboBox();
|
386 |
|
|
387 |
386 |
|
|
387 |
|
388 |
388 |
private javax.swing.JPanel jPanelPoint = null; //
|
389 |
389 |
private javax.swing.JLabel jLabel = null;
|
390 |
390 |
private javax.swing.JLabel jLabel1 = null;
|
... | ... | |
396 |
396 |
private JTextField jTxtImagen = null;
|
397 |
397 |
private JButton jBtnImagen = null;
|
398 |
398 |
/**
|
399 |
|
*
|
|
399 |
*
|
400 |
400 |
*/
|
401 |
401 |
public FPanelLegendDefault() {
|
402 |
402 |
super();
|
... | ... | |
427 |
427 |
updateControls(false);
|
428 |
428 |
|
429 |
429 |
}
|
430 |
|
|
|
430 |
|
431 |
431 |
void jbInit() throws Exception {
|
432 |
432 |
java.awt.GridBagConstraints consGridBagConstraints2 = new java.awt.GridBagConstraints();
|
433 |
433 |
|
... | ... | |
437 |
437 |
lineWidthSlider.setMajorTickSpacing(5);
|
438 |
438 |
lineWidthSlider.setMaximum(30);
|
439 |
439 |
lineWidthSlider.setMinorTickSpacing(1);
|
440 |
|
|
441 |
|
|
|
440 |
|
|
441 |
|
442 |
442 |
JPanel globalPanel = new JPanel();
|
443 |
443 |
globalPanel.setLayout(new FlowLayout());
|
444 |
|
|
|
444 |
|
445 |
445 |
linePatternCheckBox.setText(PluginServices.getText(this,"tipo_linea"));
|
446 |
446 |
fillPatternCheckBox.setText(PluginServices.getText(this,"tipo_relleno"));
|
447 |
447 |
linePatternCheckBox.addActionListener(new java.awt.event.ActionListener() {
|
... | ... | |
459 |
459 |
///globalPanel.add(getCenterPanel(),
|
460 |
460 |
/// new GridBagConstraints(0, 0, 1, 2, 0, 0, GridBagConstraints.WEST,
|
461 |
461 |
/// GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0));
|
462 |
|
|
|
462 |
|
463 |
463 |
/*globalPanel.add(new JPanel(),
|
464 |
464 |
new GridBagConstraints(3, 0, 1, 1, 1, 0, GridBagConstraints.WEST,
|
465 |
465 |
GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0)); */
|
466 |
466 |
/* globalPanel.add(new JLabel("Previsualizaci?n de s?mbolo:"),
|
467 |
467 |
new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.WEST,
|
468 |
468 |
GridBagConstraints.NONE, new Insets(0, 30, 0, 0), 0, 0)); */
|
469 |
|
|
|
469 |
|
470 |
470 |
JPanel panelAux = new JPanel();
|
471 |
471 |
panelAux.add(new JLabel(PluginServices.getText(this,"Previsualizacion_de_simbolo")));
|
472 |
472 |
centerPanel.setPreferredSize(new java.awt.Dimension(300,240));
|
473 |
473 |
panelAux.add(m_previewSymbol );
|
474 |
474 |
panelAux.setVisible(false);
|
475 |
|
/* globalPanel.add(panelAux, new
|
|
475 |
/* globalPanel.add(panelAux, new
|
476 |
476 |
GridBagConstraints(2, 1, 1, 1, 1, 1, GridBagConstraints.WEST,
|
477 |
477 |
GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); */
|
478 |
|
|
479 |
|
|
|
478 |
|
|
479 |
|
480 |
480 |
m_previewSymbol.setPreferredSize(new Dimension(80,60));
|
481 |
481 |
m_previewSymbol.setMinimumSize(new Dimension(80,60));
|
482 |
482 |
|
483 |
483 |
setLayout(null);
|
484 |
484 |
globalPanel.setBounds(0, 0, 417, 275);
|
485 |
|
|
|
485 |
|
486 |
486 |
getJPanelPoint().setBounds(0,0,350,250);
|
487 |
487 |
add(getJPanelPoint()); //, BorderLayout.WEST); //, consGridBagConstraints2);
|
488 |
488 |
add(globalPanel); // , BorderLayout.WEST);
|
489 |
|
|
|
489 |
|
490 |
490 |
panelAux.setBounds(350,0,150,100);
|
491 |
|
|
|
491 |
|
492 |
492 |
add(panelAux) ; //,BorderLayout.EAST); // Contiene el preview
|
493 |
|
|
|
493 |
|
494 |
494 |
/* globalPanel.setBackground(Color.RED);
|
495 |
495 |
getJPanelPoint().setBackground(Color.BLUE);
|
496 |
496 |
panelAux.setBackground(Color.GREEN); */
|
497 |
|
|
|
497 |
|
498 |
498 |
getCenterPanel().setLayout(new GridBagLayout());
|
499 |
499 |
setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
|
500 |
500 |
this.setSize(419, 293);
|
... | ... | |
507 |
507 |
public void actionPerformed(ActionEvent e) {
|
508 |
508 |
lineColorChooserPanel_actionPerformed(e);
|
509 |
509 |
}
|
510 |
|
});
|
511 |
|
|
|
510 |
});
|
|
511 |
|
512 |
512 |
synchronizeCheckBox.setText(PluginServices.getText(this,"sincronizar_color_borde_relleno"));
|
513 |
513 |
synchronizeCheckBox.addActionListener(new java.awt.event.ActionListener() {
|
514 |
514 |
public void actionPerformed(ActionEvent e) {
|
... | ... | |
545 |
545 |
public void actionPerformed(ActionEvent e) {
|
546 |
546 |
fillColorChooserPanel_actionPerformed(e);
|
547 |
547 |
}
|
548 |
|
});
|
|
548 |
});
|
549 |
549 |
lineWidthLabel.setText(PluginServices.getText(this,"grosor_linea"));
|
550 |
550 |
transparencyLabel.setText(PluginServices.getText(this,"transparencia"));
|
551 |
551 |
consGridBagConstraints2.gridx = 0;
|
... | ... | |
564 |
564 |
new GridBagConstraints(1, 5, 2, 1, 0.0, 0.0,
|
565 |
565 |
GridBagConstraints.WEST, GridBagConstraints.NONE,
|
566 |
566 |
new Insets(2, 2, 2, 2), 0, 0));
|
567 |
|
|
568 |
|
|
569 |
|
getCenterPanel().add(lineColorChooserPanel,
|
|
567 |
|
|
568 |
|
|
569 |
getCenterPanel().add(lineColorChooserPanel,
|
570 |
570 |
new GridBagConstraints(1, 11, 2, 1, 0.0, 0.0,
|
571 |
571 |
GridBagConstraints.WEST, GridBagConstraints.NONE,
|
572 |
|
new Insets(2, 2, 2, 2), 0, 0));
|
|
572 |
new Insets(2, 2, 2, 2), 0, 0));
|
573 |
573 |
getCenterPanel().add(transparencyPanel,
|
574 |
574 |
new GridBagConstraints(1, 21, 1, 1, 0.0, 0.0,
|
575 |
575 |
GridBagConstraints.CENTER, GridBagConstraints.NONE,
|
... | ... | |
602 |
602 |
new GridBagConstraints(1, 7, 2, 1, 0.0, 0.0,
|
603 |
603 |
GridBagConstraints.WEST, GridBagConstraints.NONE,
|
604 |
604 |
new Insets(2, 2, 0, 2), 0, 0));
|
605 |
|
|
|
605 |
|
606 |
606 |
pointTypeComboBox.setBounds(143, 25, 120, 20);
|
607 |
607 |
lineWidthSlider.setPreferredSize(new java.awt.Dimension(120,33));
|
608 |
|
pointColorChooserPanel.addActionListener(new java.awt.event.ActionListener() {
|
|
608 |
pointColorChooserPanel.addActionListener(new java.awt.event.ActionListener() {
|
609 |
609 |
public void actionPerformed(ActionEvent e) {
|
610 |
610 |
updateControls(false);
|
611 |
611 |
}
|
612 |
|
});
|
613 |
|
|
|
612 |
});
|
|
613 |
|
614 |
614 |
// this.setSize(348, 243);
|
615 |
|
|
|
615 |
|
616 |
616 |
}
|
617 |
|
|
|
617 |
|
618 |
618 |
protected void setAlpha(int alpha) {
|
619 |
619 |
transparencyPanel.getSlider().setValue(255 - alpha);
|
620 |
620 |
}
|
... | ... | |
622 |
622 |
protected int getAlpha() {
|
623 |
623 |
return 255 - transparencyPanel.getSlider().getValue();
|
624 |
624 |
}
|
625 |
|
|
|
625 |
|
626 |
626 |
void fillCheckBox_actionPerformed(ActionEvent e) {
|
627 |
627 |
updateControls(false);
|
628 |
628 |
}
|
629 |
|
|
|
629 |
|
630 |
630 |
void lineCheckBox_actionPerformed(ActionEvent e) {
|
631 |
631 |
updateControls(false);
|
632 |
632 |
}
|
... | ... | |
674 |
674 |
}
|
675 |
675 |
private void updateFillPatternColors(Color newColor) {
|
676 |
676 |
if (newColor != null)
|
677 |
|
{
|
|
677 |
{
|
678 |
678 |
fillPatterns = FSymbolFactory.createPatternFills(newColor);
|
679 |
679 |
int index=getFillPatternComboBox().getSelectedIndex();
|
680 |
680 |
//fillPatternComboBox=getFillPatternComboBox();
|
... | ... | |
682 |
682 |
getFillPatternComboBox().getModel().setSelectedItem(m_FSymbol.getFill());
|
683 |
683 |
getFillPatternComboBox().setSelectedIndex(index);
|
684 |
684 |
}
|
685 |
|
|
|
685 |
|
686 |
686 |
}
|
687 |
687 |
|
688 |
688 |
public FSymbol getSymbolFromControls()
|
689 |
|
{
|
|
689 |
{
|
690 |
690 |
if (m_FSymbol != null)
|
691 |
691 |
{
|
692 |
692 |
FSymbol aux = new FSymbol(m_FSymbol.getSymbolType());
|
693 |
693 |
aux.setShapeVisible(true);
|
694 |
694 |
Color theColor = (lineCheckBox.isSelected() &&
|
695 |
695 |
!fillCheckBox.isSelected()) ? lineColorChooserPanel.getColor()
|
696 |
|
: fillColorChooserPanel.getColor();
|
|
696 |
: fillColorChooserPanel.getColor();
|
697 |
697 |
|
698 |
698 |
if (aux.getSymbolType() == FConstant.SYMBOL_TYPE_POINT)
|
699 |
699 |
{
|
700 |
|
aux.setSize(Integer.parseInt(getJTextField().getText()));
|
701 |
|
|
|
700 |
int size = (int) Double.parseDouble(getJTextField().getText());
|
|
701 |
if (size == 0)
|
|
702 |
size = 1;
|
|
703 |
aux.setSize(size);
|
|
704 |
|
702 |
705 |
//System.out.println("Asigno el m_Size = " + getJTextField().getText());
|
703 |
|
|
|
706 |
|
704 |
707 |
if (pointTypeComboBox.getSelectedItem() instanceof Integer)
|
705 |
708 |
{
|
706 |
709 |
Integer styleSelected = (Integer) pointTypeComboBox.getSelectedItem();
|
... | ... | |
727 |
730 |
aux.setOutlined(lineCheckBox.isSelected());
|
728 |
731 |
aux.setOutlineColor(lineColorChooserPanel.getColor());
|
729 |
732 |
if (fillCheckBox.isSelected())
|
730 |
|
{
|
|
733 |
{
|
731 |
734 |
aux.setColor(new Color(theColor.getRed(),
|
732 |
735 |
theColor.getGreen(),
|
733 |
736 |
theColor.getBlue(),
|
... | ... | |
738 |
741 |
aux.setColor(null);
|
739 |
742 |
}
|
740 |
743 |
if (fillPatternCheckBox.isSelected())
|
741 |
|
{
|
|
744 |
{
|
742 |
745 |
Paint fillAux = (Paint) getFillPatternComboBox().getSelectedItem();
|
743 |
746 |
if ((fillAux != null) && (getFillPatternComboBox().getSelectedIndex() != -1))
|
744 |
|
{
|
|
747 |
{
|
745 |
748 |
aux.setFill((Paint) getFillPatternComboBox().getSelectedItem());
|
746 |
749 |
// Rellenamos el m_Style para que luego podamos escribir
|
747 |
750 |
// el tipo de relleno que lleva.
|
748 |
751 |
aux.setStyle(getFillPatternComboBox().getSelectedIndex()+3);
|
749 |
752 |
System.out.println("Asigno Style=" + m_FSymbol.getStyle());
|
750 |
753 |
}
|
751 |
|
}
|
|
754 |
}
|
752 |
755 |
else
|
753 |
756 |
aux.setFill(null);
|
754 |
|
|
|
757 |
|
755 |
758 |
float lineWidth = lineWidthSlider.getValue();
|
756 |
759 |
if (linePatternCheckBox.isSelected())
|
757 |
|
{
|
758 |
|
|
|
760 |
{
|
|
761 |
|
759 |
762 |
String linePattern = (String) linePatternComboBox.getSelectedItem();
|
760 |
|
|
|
763 |
|
761 |
764 |
// System.out.println(m_FSymbol.m_Stroke.toString());
|
762 |
765 |
aux.setStroke(new BasicStroke(lineWidth, BasicStroke.CAP_ROUND,
|
763 |
766 |
BasicStroke.JOIN_BEVEL, 1.0f,
|
764 |
767 |
FSymbol.toArray(linePattern, lineWidth), 0));
|
765 |
768 |
aux.m_LinePattern = linePattern;
|
766 |
|
|
|
769 |
|
767 |
770 |
}
|
768 |
771 |
else
|
769 |
|
{
|
|
772 |
{
|
770 |
773 |
aux.m_LinePattern = "0";
|
771 |
|
if (lineWidth ==0)
|
|
774 |
if (lineWidth ==0)
|
772 |
775 |
aux.setStroke(null);
|
773 |
776 |
else
|
774 |
777 |
aux.setStroke(new BasicStroke(lineWidth, BasicStroke.CAP_ROUND,
|
... | ... | |
777 |
780 |
// System.out.println(fillPatternComboBox.getSelectedItem().toString() + " " + linePatternComboBox.getSelectedItem().toString());
|
778 |
781 |
// JOptionPane.showMessageDialog(this,"HOla","Colega", JOptionPane.INFORMATION_MESSAGE);
|
779 |
782 |
return aux;
|
780 |
|
}
|
|
783 |
}
|
781 |
784 |
return null;
|
782 |
|
|
|
785 |
|
783 |
786 |
}
|
784 |
787 |
/**
|
785 |
788 |
* @param bInternal
|
... | ... | |
797 |
800 |
lineColorChooserPanel.setAlpha(getAlpha());
|
798 |
801 |
Color theColor = (lineCheckBox.isSelected() &&
|
799 |
802 |
!fillCheckBox.isSelected()) ? lineColorChooserPanel.getColor()
|
800 |
|
: fillColorChooserPanel.getColor();
|
|
803 |
: fillColorChooserPanel.getColor();
|
801 |
804 |
transparencyPanel.setColor(theColor);
|
802 |
805 |
/* if (jTxtImagen != null)
|
803 |
806 |
{
|
... | ... | |
806 |
809 |
jBtnImagen.setVisible(false);
|
807 |
810 |
} */
|
808 |
811 |
if (m_FSymbol != null)
|
809 |
|
{
|
|
812 |
{
|
810 |
813 |
/* if (m_FSymbol.getSymbolType() == FConstant.SYMBOL_TYPE_POINT)
|
811 |
814 |
{
|
812 |
815 |
if (m_FSymbol.getStyle() == FConstant.SYMBOL_STYLE_MARKER_IMAGEN)
|
... | ... | |
819 |
822 |
} */
|
820 |
823 |
// System.out.println(fillPatternComboBox.getSelectedItem().toString() + " " + linePatternComboBox.getSelectedItem().toString());
|
821 |
824 |
// JOptionPane.showMessageDialog(this,"HOla","Colega", JOptionPane.INFORMATION_MESSAGE);
|
822 |
|
}
|
823 |
|
updateFillPatternColors(theColor);
|
|
825 |
}
|
|
826 |
updateFillPatternColors(theColor);
|
824 |
827 |
getFillPatternComboBox().repaint();
|
825 |
828 |
if (m_FSymbol != null)
|
826 |
829 |
{
|
827 |
|
|
|
830 |
|
828 |
831 |
m_previewSymbol.setSymbol(getSymbolFromControls());
|
829 |
832 |
}
|
830 |
833 |
|
831 |
834 |
}
|
832 |
|
|
|
835 |
|
833 |
836 |
public void setFSymbol(FSymbol s)
|
834 |
837 |
{
|
835 |
838 |
// bDisableUpdateControls = true;
|
... | ... | |
840 |
843 |
m_FSymbol = s.fastCloneSymbol();
|
841 |
844 |
m_previewSymbol.setSymbol(m_FSymbol);
|
842 |
845 |
if ((m_FSymbol.getSymbolType() == FConstant.SYMBOL_TYPE_FILL) || (m_FSymbol.getSymbolType() == FShape.MULTI))
|
843 |
|
{
|
|
846 |
{
|
844 |
847 |
// Deber?amos habilitar la pesta?a de pol?gonos
|
845 |
848 |
getJPanelPoint().setVisible(false);
|
846 |
849 |
getCenterPanel().setVisible(true);
|
... | ... | |
851 |
854 |
getFillPatternComboBox().setVisible(true);
|
852 |
855 |
lineCheckBox.setVisible(true);
|
853 |
856 |
lineColorChooserPanel.setVisible(true);
|
854 |
|
|
|
857 |
|
855 |
858 |
linePatternCheckBox.setSelected(false);
|
856 |
859 |
if (m_FSymbol.getFill() != null)
|
857 |
860 |
{
|
... | ... | |
863 |
866 |
lineCheckBox.setSelected(m_FSymbol.isOutlined());
|
864 |
867 |
if (m_FSymbol.getColor() != null)
|
865 |
868 |
{
|
866 |
|
fillCheckBox.setSelected(true);
|
|
869 |
fillCheckBox.setSelected(true);
|
867 |
870 |
fillColorChooserPanel.setColor(m_FSymbol.getColor());
|
868 |
871 |
setAlpha(m_FSymbol.getColor().getAlpha());
|
869 |
872 |
fillColorChooserPanel.setAlpha(getAlpha());
|
870 |
|
lineColorChooserPanel.setAlpha(getAlpha());
|
|
873 |
lineColorChooserPanel.setAlpha(getAlpha());
|
871 |
874 |
}
|
872 |
875 |
else
|
873 |
876 |
{
|
... | ... | |
878 |
881 |
{
|
879 |
882 |
BasicStroke aux = (BasicStroke) m_FSymbol.getStroke();
|
880 |
883 |
if (aux.getDashArray() != null)
|
881 |
|
{
|
882 |
|
linePatternCheckBox.setSelected(true);
|
|
884 |
{
|
|
885 |
linePatternCheckBox.setSelected(true);
|
883 |
886 |
linePatternComboBox.setSelectedItem(m_FSymbol.m_LinePattern);
|
884 |
887 |
}
|
885 |
888 |
outlineSize = (int) aux.getLineWidth();
|
886 |
|
|
|
889 |
|
887 |
890 |
}
|
888 |
|
|
|
891 |
|
889 |
892 |
lineColorChooserPanel.setColor(m_FSymbol.getOutlineColor());
|
890 |
893 |
lineWidthSlider.setValue(outlineSize);
|
891 |
|
|
|
894 |
|
892 |
895 |
}
|
893 |
896 |
if (m_FSymbol.getSymbolType() == FConstant.SYMBOL_TYPE_LINE)
|
894 |
897 |
{
|
895 |
898 |
getJPanelPoint().setVisible(false);
|
896 |
|
getCenterPanel().setVisible(true);
|
897 |
|
fillCheckBox.setText(PluginServices.getText(this,"linea")); // Lo vamos a usar como color de l?nea
|
898 |
|
fillCheckBox.setSelected(true);
|
|
899 |
getCenterPanel().setVisible(true);
|
|
900 |
fillCheckBox.setText(PluginServices.getText(this,"linea")); // Lo vamos a usar como color de l?nea
|
|
901 |
fillCheckBox.setSelected(true);
|
899 |
902 |
synchronizeCheckBox.setVisible(false);
|
900 |
903 |
fillPatternCheckBox.setVisible(false);
|
901 |
904 |
getFillPatternComboBox().setVisible(false);
|
... | ... | |
910 |
913 |
BasicStroke aux = (BasicStroke) m_FSymbol.getStroke();
|
911 |
914 |
// if (aux.getDashArray() != null)
|
912 |
915 |
if (m_FSymbol.m_LinePattern.compareTo("0") != 0)
|
913 |
|
{
|
914 |
|
linePatternCheckBox.setSelected(true);
|
|
916 |
{
|
|
917 |
linePatternCheckBox.setSelected(true);
|
915 |
918 |
linePatternComboBox.setSelectedItem(m_FSymbol.m_LinePattern);
|
916 |
919 |
}
|
917 |
920 |
outlineSize = (int) (aux.getLineWidth());
|
918 |
|
|
|
921 |
|
919 |
922 |
}
|
920 |
923 |
if (m_FSymbol.getColor() != null)
|
921 |
924 |
{
|
922 |
925 |
lineColorChooserPanel.setColor(m_FSymbol.getColor());
|
923 |
926 |
setAlpha(m_FSymbol.getColor().getAlpha());
|
924 |
|
lineColorChooserPanel.setAlpha(getAlpha());
|
|
927 |
lineColorChooserPanel.setAlpha(getAlpha());
|
925 |
928 |
}
|
926 |
929 |
lineWidthSlider.setValue(outlineSize);
|
927 |
930 |
}
|
... | ... | |
935 |
938 |
getJTextField().setText("" + m_FSymbol.getSize());
|
936 |
939 |
getJCheckBox().setSelected(!m_FSymbol.isSizeInPixels());
|
937 |
940 |
getJComboBox_pointType().setSelectedItem(new Integer(m_FSymbol.getStyle()));
|
938 |
|
|
|
941 |
|
939 |
942 |
if (m_FSymbol.getStyle() == FConstant.SYMBOL_STYLE_MARKER_IMAGEN && m_FSymbol.getIconURI()!=null)
|
940 |
943 |
{
|
941 |
944 |
File fProv = new File(m_FSymbol.getIconURI());
|
... | ... | |
944 |
947 |
jLblImagen.setVisible(true);
|
945 |
948 |
jBtnImagen.setVisible(true);
|
946 |
949 |
}
|
947 |
|
|
|
950 |
|
948 |
951 |
}
|
949 |
952 |
// bDisableUpdateControls = false;
|
950 |
953 |
// setAlpha(255 - m_FSymbol.m_Transparency);
|
951 |
|
|
|
954 |
|
952 |
955 |
}
|
953 |
956 |
|
954 |
957 |
/**
|
... | ... | |
969 |
972 |
|
970 |
973 |
/**
|
971 |
974 |
|
972 |
|
* This method initializes jPanel
|
|
975 |
* This method initializes jPanel
|
973 |
976 |
|
974 |
|
*
|
|
977 |
*
|
975 |
978 |
|
976 |
|
* @return javax.swing.JPanel
|
|
979 |
* @return javax.swing.JPanel
|
977 |
980 |
|
978 |
|
*/
|
|
981 |
*/
|
979 |
982 |
protected javax.swing.JPanel getJPanelPoint() {
|
980 |
983 |
if (jPanelPoint == null) {
|
981 |
984 |
jLblImagen = new JLabel();
|
... | ... | |
1003 |
1006 |
|
1004 |
1007 |
/**
|
1005 |
1008 |
|
1006 |
|
* This method initializes jLabel
|
|
1009 |
* This method initializes jLabel
|
1007 |
1010 |
|
1008 |
|
*
|
|
1011 |
*
|
1009 |
1012 |
|
1010 |
|
* @return javax.swing.JLabel
|
|
1013 |
* @return javax.swing.JLabel
|
1011 |
1014 |
|
1012 |
|
*/
|
|
1015 |
*/
|
1013 |
1016 |
private javax.swing.JLabel getJLabel() {
|
1014 |
1017 |
if (jLabel == null) {
|
1015 |
1018 |
jLabel = new javax.swing.JLabel();
|
... | ... | |
1021 |
1024 |
|
1022 |
1025 |
/**
|
1023 |
1026 |
|
1024 |
|
* This method initializes jLabel1
|
|
1027 |
* This method initializes jLabel1
|
1025 |
1028 |
|
1026 |
|
*
|
|
1029 |
*
|
1027 |
1030 |
|
1028 |
|
* @return javax.swing.JLabel
|
|
1031 |
* @return javax.swing.JLabel
|
1029 |
1032 |
|
1030 |
|
*/
|
|
1033 |
*/
|
1031 |
1034 |
private javax.swing.JLabel getJLabel1() {
|
1032 |
1035 |
if (jLabel1 == null) {
|
1033 |
1036 |
jLabel1 = new javax.swing.JLabel();
|
... | ... | |
1039 |
1042 |
|
1040 |
1043 |
/**
|
1041 |
1044 |
|
1042 |
|
* This method initializes jCheckBox
|
|
1045 |
* This method initializes jCheckBox
|
1043 |
1046 |
|
1044 |
|
*
|
|
1047 |
*
|
1045 |
1048 |
|
1046 |
|
* @return javax.swing.JCheckBox
|
|
1049 |
* @return javax.swing.JCheckBox
|
1047 |
1050 |
|
1048 |
|
*/
|
|
1051 |
*/
|
1049 |
1052 |
private javax.swing.JCheckBox getJCheckBox() {
|
1050 |
1053 |
if (jCheckBox == null) {
|
1051 |
1054 |
jCheckBox = new javax.swing.JCheckBox();
|
... | ... | |
1057 |
1060 |
|
1058 |
1061 |
/**
|
1059 |
1062 |
|
1060 |
|
* This method initializes jTextField
|
|
1063 |
* This method initializes jTextField
|
1061 |
1064 |
|
1062 |
|
*
|
|
1065 |
*
|
1063 |
1066 |
|
1064 |
|
* @return javax.swing.JTextField
|
|
1067 |
* @return javax.swing.JTextField
|
1065 |
1068 |
|
1066 |
|
*/
|
|
1069 |
*/
|
1067 |
1070 |
protected javax.swing.JTextField getJTextField() {
|
1068 |
1071 |
if (jTextField_Size == null) {
|
1069 |
1072 |
jTextField_Size = new javax.swing.JTextField();
|
... | ... | |
1080 |
1083 |
|
1081 |
1084 |
/**
|
1082 |
1085 |
|
1083 |
|
* This method initializes jComboBox
|
|
1086 |
* This method initializes jComboBox
|
1084 |
1087 |
|
1085 |
|
*
|
|
1088 |
*
|
1086 |
1089 |
|
1087 |
|
* @return javax.swing.JComboBox
|
|
1090 |
* @return javax.swing.JComboBox
|
1088 |
1091 |
|
1089 |
|
*/
|
|
1092 |
*/
|
1090 |
1093 |
private javax.swing.JComboBox getJComboBox_pointType() {
|
1091 |
1094 |
if (jComboBox_Symbol_Type == null) {
|
1092 |
1095 |
jComboBox_Symbol_Type = new javax.swing.JComboBox();
|
... | ... | |
1098 |
1101 |
|
1099 |
1102 |
/**
|
1100 |
1103 |
|
1101 |
|
* This method initializes jLabel2
|
|
1104 |
* This method initializes jLabel2
|
1102 |
1105 |
|
1103 |
|
*
|
|
1106 |
*
|
1104 |
1107 |
|
1105 |
|
* @return javax.swing.JLabel
|
|
1108 |
* @return javax.swing.JLabel
|
1106 |
1109 |
|
1107 |
|
*/
|
|
1110 |
*/
|
1108 |
1111 |
private javax.swing.JLabel getJLabel2() {
|
1109 |
1112 |
if (jLabel2 == null) {
|
1110 |
1113 |
jLabel2 = new javax.swing.JLabel();
|
... | ... | |
1115 |
1118 |
}
|
1116 |
1119 |
|
1117 |
1120 |
/**
|
1118 |
|
* This method initializes jTextField
|
1119 |
|
*
|
1120 |
|
* @return javax.swing.JTextField
|
1121 |
|
*/
|
|
1121 |
* This method initializes jTextField
|
|
1122 |
*
|
|
1123 |
* @return javax.swing.JTextField
|
|
1124 |
*/
|
1122 |
1125 |
private JTextField getJTextField2() {
|
1123 |
1126 |
if (jTxtImagen == null) {
|
1124 |
1127 |
jTxtImagen = new JTextField();
|
... | ... | |
1127 |
1130 |
return jTxtImagen;
|
1128 |
1131 |
}
|
1129 |
1132 |
/**
|
1130 |
|
* This method initializes jButton
|
1131 |
|
*
|
1132 |
|
* @return javax.swing.JButton
|
1133 |
|
*/
|
|
1133 |
* This method initializes jButton
|
|
1134 |
*
|
|
1135 |
* @return javax.swing.JButton
|
|
1136 |
*/
|
1134 |
1137 |
private JButton getJBtnImagen() {
|
1135 |
1138 |
if (jBtnImagen == null) {
|
1136 |
1139 |
jBtnImagen = new JButton();
|
1137 |
1140 |
jBtnImagen.setBounds(279, 139, 33, 18);
|
1138 |
1141 |
jBtnImagen.setText("...");
|
1139 |
1142 |
jBtnImagen.setToolTipText(PluginServices.getText(this,"browse"));
|
1140 |
|
jBtnImagen.addActionListener(new java.awt.event.ActionListener() {
|
1141 |
|
public void actionPerformed(java.awt.event.ActionEvent e) {
|
|
1143 |
jBtnImagen.addActionListener(new java.awt.event.ActionListener() {
|
|
1144 |
public void actionPerformed(java.awt.event.ActionEvent e) {
|
1142 |
1145 |
JFileChooser tempChooser = new JFileChooser();
|
1143 |
1146 |
ImageFilter filter = new ImageFilter();
|
1144 |
1147 |
tempChooser.setFileFilter(filter);
|
... | ... | |
1164 |
1167 |
//else
|
1165 |
1168 |
|
1166 |
1169 |
setFSymbol(legend.getDefaultSymbol());
|
1167 |
|
|
|
1170 |
|
1168 |
1171 |
}
|
1169 |
1172 |
/* (non-Javadoc)
|
1170 |
1173 |
* @see com.iver.cit.gvsig.gui.legendmanager.panels.ILegendPanel#getLegend()
|