Revision 597 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendDefault.java
FPanelLegendDefault.java | ||
---|---|---|
171 | 171 |
|
172 | 172 |
FPoint2D shp = new FPoint2D(panel.getWidth()/2, |
173 | 173 |
panel.getHeight()/2); |
174 |
myFSymbol.m_Color = m_FSymbol.m_Color;
|
|
174 |
myFSymbol.setColor(m_FSymbol.getColor());
|
|
175 | 175 |
FGraphicUtilities.DrawShape(g2,mT, shp,myFSymbol); |
176 | 176 |
} |
177 | 177 |
}; |
... | ... | |
181 | 181 |
JList list, Object value, int index, |
182 | 182 |
boolean isSelected, boolean cellHasFocus) { |
183 | 183 |
pointType = (Integer) value; |
184 |
myFSymbol.m_Style = pointType.intValue();
|
|
184 |
myFSymbol.setStyle(pointType.intValue());
|
|
185 | 185 |
// Le hacemos que se dibuje siempre con 10 pixels |
186 | 186 |
|
187 |
myFSymbol.m_bUseSize = false;
|
|
188 |
myFSymbol.m_Size = 10;
|
|
189 |
myFSymbol.m_Stroke = new BasicStroke();
|
|
187 |
myFSymbol.setSizeInPixels(false);
|
|
188 |
myFSymbol.setSize(10);
|
|
189 |
myFSymbol.setStroke(new BasicStroke());
|
|
190 | 190 |
panel.setForeground(UIManager.getColor(isSelected |
191 | 191 |
? "ComboBox.selectionForeground" |
192 | 192 |
: "ComboBox.foreground")); |
... | ... | |
620 | 620 |
updateControls(); |
621 | 621 |
} |
622 | 622 |
private void updateFillPatternColors() { |
623 |
if ((m_FSymbol != null) && (m_FSymbol.m_Color != null))
|
|
623 |
if ((m_FSymbol != null) && (m_FSymbol.getColor() != null))
|
|
624 | 624 |
{ |
625 |
fillPatterns = FSymbolFactory.createPatternFills(m_FSymbol.m_Color);
|
|
625 |
fillPatterns = FSymbolFactory.createPatternFills(m_FSymbol.getColor());
|
|
626 | 626 |
fillPatternComboBox.setModel(new DefaultComboBoxModel(fillPatterns)); |
627 |
fillPatternComboBox.getModel().setSelectedItem(m_FSymbol.m_Fill);
|
|
627 |
fillPatternComboBox.getModel().setSelectedItem(m_FSymbol.getFill());
|
|
628 | 628 |
// fillPatternComboBox.setSelectedItem(m_FSymbol.m_Fill); |
629 | 629 |
} |
630 | 630 |
|
... | ... | |
649 | 649 |
} |
650 | 650 |
if (m_FSymbol != null) |
651 | 651 |
{ |
652 |
if (m_FSymbol.m_symbolType == FConstant.SYMBOL_TYPE_POINT)
|
|
652 |
if (m_FSymbol.getSymbolType() == FConstant.SYMBOL_TYPE_POINT)
|
|
653 | 653 |
{ |
654 |
m_FSymbol.m_Size = Integer.parseInt(getJTextField().getText());
|
|
654 |
m_FSymbol.setSize(Integer.parseInt(getJTextField().getText()));
|
|
655 | 655 |
|
656 | 656 |
//System.out.println("Asigno el m_Size = " + getJTextField().getText()); |
657 | 657 |
|
658 | 658 |
if (pointTypeComboBox.getSelectedItem() instanceof Integer) |
659 | 659 |
{ |
660 | 660 |
Integer styleSelected = (Integer) pointTypeComboBox.getSelectedItem(); |
661 |
m_FSymbol.m_Style = styleSelected.intValue();
|
|
661 |
m_FSymbol.setStyle(styleSelected.intValue());
|
|
662 | 662 |
} |
663 | 663 |
else |
664 | 664 |
{ |
665 | 665 |
Integer styleSelected = pointTypeToInt((String) pointTypeComboBox.getSelectedItem()); |
666 |
m_FSymbol.m_Style = styleSelected.intValue();
|
|
666 |
m_FSymbol.setStyle(styleSelected.intValue());
|
|
667 | 667 |
} |
668 |
if (m_FSymbol.m_Style == FConstant.SYMBOL_STYLE_MARKER_IMAGEN)
|
|
668 |
if (m_FSymbol.getStyle() == FConstant.SYMBOL_STYLE_MARKER_IMAGEN)
|
|
669 | 669 |
{ |
670 | 670 |
jTxtImagen.setVisible(true); |
671 | 671 |
jLblImagen.setVisible(true); |
672 | 672 |
jBtnImagen.setVisible(true); |
673 | 673 |
if (jTxtImagen.getText().compareTo("") != 0) |
674 | 674 |
{ |
675 |
m_FSymbol.m_Icon = new ImageIcon(jTxtImagen.getText()).getImage();
|
|
675 |
m_FSymbol.setIcon(new ImageIcon(jTxtImagen.getText()).getImage());
|
|
676 | 676 |
} |
677 | 677 |
} |
678 |
m_FSymbol.m_Color = pointColorChooserPanel.getColor();
|
|
679 |
m_FSymbol.m_bUseSize = getJCheckBox().isSelected();
|
|
678 |
m_FSymbol.setColor(pointColorChooserPanel.getColor());
|
|
679 |
m_FSymbol.setSizeInPixels(getJCheckBox().isSelected());
|
|
680 | 680 |
pointColorChooserPanel.repaint(); |
681 | 681 |
m_previewSymbol.setSymbol(m_FSymbol); |
682 | 682 |
return; |
683 | 683 |
} |
684 |
m_FSymbol.m_useOutline = lineCheckBox.isSelected();
|
|
685 |
m_FSymbol.m_outlineColor = lineColorChooserPanel.getColor();
|
|
684 |
m_FSymbol.setOutlined(lineCheckBox.isSelected());
|
|
685 |
m_FSymbol.setOutlineColor(lineColorChooserPanel.getColor());
|
|
686 | 686 |
if (fillCheckBox.isSelected()) |
687 | 687 |
{ |
688 |
m_FSymbol.m_Color = new Color(theColor.getRed(),
|
|
688 |
m_FSymbol.setColor(new Color(theColor.getRed(),
|
|
689 | 689 |
theColor.getGreen(), |
690 | 690 |
theColor.getBlue(), |
691 |
getAlpha()); |
|
691 |
getAlpha()));
|
|
692 | 692 |
} |
693 | 693 |
else |
694 | 694 |
{ |
695 |
m_FSymbol.m_Color = null;
|
|
695 |
m_FSymbol.setColor(null);
|
|
696 | 696 |
} |
697 | 697 |
if (fillPatternCheckBox.isSelected()) |
698 | 698 |
{ |
699 | 699 |
Paint fillAux = (Paint) fillPatternComboBox.getSelectedItem(); |
700 | 700 |
if (fillAux != null) |
701 | 701 |
{ |
702 |
m_FSymbol.m_Fill = (Paint) fillPatternComboBox.getSelectedItem();
|
|
702 |
m_FSymbol.setFill((Paint) fillPatternComboBox.getSelectedItem());
|
|
703 | 703 |
// Rellenamos el m_Style para que luego podamos escribir |
704 | 704 |
// el tipo de relleno que lleva. |
705 |
m_FSymbol.m_Style = fillPatternComboBox.getSelectedIndex()+3;
|
|
705 |
m_FSymbol.setStyle(fillPatternComboBox.getSelectedIndex()+3);
|
|
706 | 706 |
//System.out.println("Asigno m_Fill=" + m_FSymbol.m_Fill.toString()); |
707 | 707 |
} |
708 | 708 |
} |
709 | 709 |
else |
710 |
m_FSymbol.m_Fill = null;
|
|
710 |
m_FSymbol.setFill(null);
|
|
711 | 711 |
|
712 | 712 |
float lineWidth = lineWidthSlider.getValue(); |
713 | 713 |
if (linePatternCheckBox.isSelected()) |
714 | 714 |
{ |
715 | 715 |
String linePattern = (String) linePatternComboBox.getSelectedItem(); |
716 | 716 |
// System.out.println(m_FSymbol.m_Stroke.toString()); |
717 |
m_FSymbol.m_Stroke = new BasicStroke(lineWidth, BasicStroke.CAP_ROUND,
|
|
717 |
m_FSymbol.setStroke(new BasicStroke(lineWidth, BasicStroke.CAP_ROUND,
|
|
718 | 718 |
BasicStroke.JOIN_BEVEL, 1.0f, |
719 |
toArray(linePattern, lineWidth), 0); |
|
719 |
toArray(linePattern, lineWidth), 0));
|
|
720 | 720 |
|
721 | 721 |
m_FSymbol.m_LinePattern = linePattern; |
722 | 722 |
} |
723 | 723 |
else |
724 | 724 |
{ |
725 | 725 |
if (lineWidth <=1) |
726 |
m_FSymbol.m_Stroke = null;
|
|
726 |
m_FSymbol.setStroke(null);
|
|
727 | 727 |
else |
728 |
m_FSymbol.m_Stroke = new BasicStroke(lineWidth, BasicStroke.CAP_ROUND,
|
|
729 |
BasicStroke.JOIN_BEVEL); |
|
728 |
m_FSymbol.setStroke(new BasicStroke(lineWidth, BasicStroke.CAP_ROUND,
|
|
729 |
BasicStroke.JOIN_BEVEL));
|
|
730 | 730 |
} |
731 | 731 |
// System.out.println(fillPatternComboBox.getSelectedItem().toString() + " " + linePatternComboBox.getSelectedItem().toString()); |
732 | 732 |
// JOptionPane.showMessageDialog(this,"HOla","Colega", JOptionPane.INFORMATION_MESSAGE); |
... | ... | |
741 | 741 |
{ |
742 | 742 |
m_FSymbol = s.cloneSymbol(); |
743 | 743 |
m_previewSymbol.setSymbol(m_FSymbol); |
744 |
if (m_FSymbol.m_symbolType == FConstant.SYMBOL_TYPE_FILL)
|
|
744 |
if (m_FSymbol.getSymbolType() == FConstant.SYMBOL_TYPE_FILL)
|
|
745 | 745 |
{ |
746 | 746 |
// Deber?amos habilitar la pesta?a de pol?gonos |
747 | 747 |
getJPanelPoint().setVisible(false); |
... | ... | |
753 | 753 |
lineCheckBox.setVisible(true); |
754 | 754 |
lineColorChooserPanel.setVisible(true); |
755 | 755 |
|
756 |
lineCheckBox.setSelected(m_FSymbol.m_useOutline);
|
|
757 |
lineColorChooserPanel.setColor(m_FSymbol.m_outlineColor);
|
|
758 |
if (m_FSymbol.m_Color != null)
|
|
756 |
lineCheckBox.setSelected(m_FSymbol.isOutlined());
|
|
757 |
lineColorChooserPanel.setColor(m_FSymbol.geOutlineColor());
|
|
758 |
if (m_FSymbol.getColor() != null)
|
|
759 | 759 |
{ |
760 | 760 |
fillCheckBox.setSelected(true); |
761 |
fillColorChooserPanel.setColor(m_FSymbol.m_Color);
|
|
762 |
setAlpha(m_FSymbol.m_Color.getAlpha());
|
|
761 |
fillColorChooserPanel.setColor(m_FSymbol.getColor());
|
|
762 |
setAlpha(m_FSymbol.getColor().getAlpha());
|
|
763 | 763 |
fillColorChooserPanel.setAlpha(getAlpha()); |
764 | 764 |
lineColorChooserPanel.setAlpha(getAlpha()); |
765 | 765 |
} |
... | ... | |
769 | 769 |
} |
770 | 770 |
|
771 | 771 |
linePatternCheckBox.setSelected(false); |
772 |
if (m_FSymbol.m_Stroke != null)
|
|
772 |
if (m_FSymbol.getStroke() != null)
|
|
773 | 773 |
{ |
774 |
BasicStroke aux = (BasicStroke) m_FSymbol.m_Stroke;
|
|
774 |
BasicStroke aux = (BasicStroke) m_FSymbol.getStroke();
|
|
775 | 775 |
if (aux.getDashArray() != null) |
776 | 776 |
{ |
777 | 777 |
linePatternCheckBox.setSelected(true); |
... | ... | |
779 | 779 |
} |
780 | 780 |
} |
781 | 781 |
} |
782 |
if (m_FSymbol.m_symbolType == FConstant.SYMBOL_TYPE_LINE)
|
|
782 |
if (m_FSymbol.getSymbolType() == FConstant.SYMBOL_TYPE_LINE)
|
|
783 | 783 |
{ |
784 | 784 |
getJPanelPoint().setVisible(false); |
785 | 785 |
getCenterPanel().setVisible(true); |
... | ... | |
790 | 790 |
fillPatternComboBox.setVisible(false); |
791 | 791 |
lineCheckBox.setSelected(true); |
792 | 792 |
lineCheckBox.setVisible(false); |
793 |
fillColorChooserPanel.setColor(m_FSymbol.m_Color);
|
|
793 |
fillColorChooserPanel.setColor(m_FSymbol.getColor());
|
|
794 | 794 |
lineColorChooserPanel.setVisible(false); |
795 |
if (m_FSymbol.m_Color != null)
|
|
795 |
if (m_FSymbol.getColor() != null)
|
|
796 | 796 |
{ |
797 |
lineColorChooserPanel.setColor(m_FSymbol.m_Color);
|
|
798 |
setAlpha(m_FSymbol.m_Color.getAlpha());
|
|
797 |
lineColorChooserPanel.setColor(m_FSymbol.getColor());
|
|
798 |
setAlpha(m_FSymbol.getColor().getAlpha());
|
|
799 | 799 |
lineColorChooserPanel.setAlpha(getAlpha()); |
800 | 800 |
} |
801 | 801 |
|
802 | 802 |
linePatternCheckBox.setSelected(false); |
803 |
if (m_FSymbol.m_Stroke != null)
|
|
803 |
if (m_FSymbol.getStroke() != null)
|
|
804 | 804 |
{ |
805 |
BasicStroke aux = (BasicStroke) m_FSymbol.m_Stroke;
|
|
805 |
BasicStroke aux = (BasicStroke) m_FSymbol.getStroke();
|
|
806 | 806 |
if (aux.getDashArray() != null) |
807 | 807 |
{ |
808 | 808 |
linePatternCheckBox.setSelected(true); |
... | ... | |
810 | 810 |
} |
811 | 811 |
} |
812 | 812 |
} |
813 |
if (m_FSymbol.m_symbolType == FConstant.SYMBOL_TYPE_POINT)
|
|
813 |
if (m_FSymbol.getSymbolType() == FConstant.SYMBOL_TYPE_POINT)
|
|
814 | 814 |
{ |
815 | 815 |
getCenterPanel().setVisible(false); |
816 | 816 |
getJPanelPoint().setVisible(true); |
817 |
if (m_FSymbol.m_Color!=null){
|
|
818 |
pointColorChooserPanel.setColor(m_FSymbol.m_Color);
|
|
817 |
if (m_FSymbol.getColor()!=null){
|
|
818 |
pointColorChooserPanel.setColor(m_FSymbol.getColor());
|
|
819 | 819 |
} |
820 |
getJTextField().setText("" + m_FSymbol.m_Size);
|
|
821 |
getJCheckBox().setSelected(m_FSymbol.m_bUseSize);
|
|
822 |
getJComboBox_pointType().setSelectedItem(new Integer(m_FSymbol.m_Style));
|
|
820 |
getJTextField().setText("" + m_FSymbol.getSize());
|
|
821 |
getJCheckBox().setSelected(m_FSymbol.isSizeInPixels());
|
|
822 |
getJComboBox_pointType().setSelectedItem(new Integer(m_FSymbol.getStyle()));
|
|
823 | 823 |
|
824 | 824 |
} |
825 | 825 |
|
Also available in: Unified diff