Revision 145 branches/usability_v2/org.gvsig.app.document.layout.app/org.gvsig.app.document.layout.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/fframes/FFrame.java
FFrame.java | ||
---|---|---|
42 | 42 |
import org.gvsig.app.project.documents.layout.LayoutControl; |
43 | 43 |
import org.gvsig.app.project.documents.layout.LayoutManager; |
44 | 44 |
import org.gvsig.app.project.documents.layout.LayoutNotification; |
45 |
import org.gvsig.app.project.documents.layout.gui.LayoutPanel; |
|
45 | 46 |
import org.gvsig.tools.ToolsLocator; |
46 |
import org.gvsig.tools.dispose.Disposable; |
|
47 | 47 |
import org.gvsig.tools.dynobject.DynStruct; |
48 | 48 |
import org.gvsig.tools.observer.Observable; |
49 | 49 |
import org.gvsig.tools.observer.ObservableHelper; |
... | ... | |
71 | 71 |
private static final String ROTATION_FIELD = "rotation"; |
72 | 72 |
private static final String LEVEL_FIELD = "level"; |
73 | 73 |
private static final String NUM_FIELD = "num"; |
74 |
private static final String LAYOUTPANEL_FIELD = "layoutPanel"; |
|
74 | 75 |
|
75 | 76 |
protected static final Logger LOG = LoggerFactory.getLogger(FFrame.class); |
76 | 77 |
|
... | ... | |
102 | 103 |
private static Image iSEResize = null; |
103 | 104 |
|
104 | 105 |
protected LayoutManager layoutManager = null; |
105 |
protected LayoutContext layoutContext = null; |
|
106 |
protected LayoutControl layoutControl = null; |
|
106 |
private LayoutContext layoutContext = null; |
|
107 |
private LayoutControl layoutControl = null; |
|
108 |
private LayoutPanel layoutPanel = null; |
|
107 | 109 |
|
108 | 110 |
protected ObservableHelper observers; |
109 | 111 |
|
... | ... | |
186 | 188 |
* el fframe. |
187 | 189 |
*/ |
188 | 190 |
public void setSelected(Point2D p, MouseEvent e) { |
189 |
m_Selected = getContains(p);
|
|
191 |
doSetSelected(getContains(p));
|
|
190 | 192 |
} |
191 | 193 |
|
192 | 194 |
/** |
... | ... | |
546 | 548 |
*/ |
547 | 549 |
public void setSelected(boolean b) { |
548 | 550 |
if (b) { |
549 |
m_Selected = RECT;
|
|
551 |
doSetSelected(IFFrame.RECT);
|
|
550 | 552 |
} else { |
551 |
m_Selected = IFFrame.NOSELECT;
|
|
553 |
doSetSelected(IFFrame.NOSELECT);
|
|
552 | 554 |
} |
553 | 555 |
} |
556 |
|
|
557 |
protected void doSetSelected(int selectedStatus) { |
|
558 |
m_Selected = selectedStatus; |
|
559 |
} |
|
554 | 560 |
|
555 | 561 |
/** |
556 | 562 |
* Dibuja sobre el graphics el rect�ngulo del fframe en modo borrador. |
... | ... | |
752 | 758 |
definition.addDynFieldDouble(ROTATION_FIELD).setMandatory(true); |
753 | 759 |
definition.addDynFieldInt(LEVEL_FIELD).setMandatory(true); |
754 | 760 |
definition.addDynFieldInt(NUM_FIELD).setMandatory(true); |
761 |
definition.addDynFieldObject(LAYOUTPANEL_FIELD).setClassOfValue(LayoutPanel.class).setMandatory(false); |
|
755 | 762 |
} |
756 | 763 |
|
757 | 764 |
Attributes.registerPersistent(); |
... | ... | |
779 | 786 |
m_rotation = state.getDouble(ROTATION_FIELD); |
780 | 787 |
level = state.getInt(LEVEL_FIELD); |
781 | 788 |
num = state.getInt(NUM_FIELD); |
789 |
if (state.hasValue(LAYOUTPANEL_FIELD)) { |
|
790 |
setLayoutPanel((LayoutPanel)state.get(LAYOUTPANEL_FIELD )); |
|
791 |
} |
|
782 | 792 |
} |
783 | 793 |
|
784 | 794 |
public void saveToState(PersistentState state) throws PersistenceException { |
... | ... | |
788 | 798 |
state.set(ROTATION_FIELD, getRotation()); |
789 | 799 |
state.set(LEVEL_FIELD, getLevel()); |
790 | 800 |
state.set(NUM_FIELD, num); |
801 |
state.set(LAYOUTPANEL_FIELD, getLayoutPanel()); |
|
791 | 802 |
} |
792 | 803 |
|
793 | 804 |
public void addObserver(Observer o) { |
... | ... | |
849 | 860 |
} |
850 | 861 |
} |
851 | 862 |
} |
863 |
|
|
864 |
public LayoutPanel getLayoutPanel() { |
|
865 |
return layoutPanel; |
|
866 |
} |
|
867 |
|
|
868 |
public void setLayoutPanel(LayoutPanel layoutPanel) { |
|
869 |
this.layoutPanel = layoutPanel; |
|
870 |
} |
|
871 |
|
|
872 |
public LayoutContext getLayoutContext() { |
|
873 |
return layoutContext; |
|
874 |
} |
|
875 |
|
|
876 |
public void setLayoutContext(LayoutContext layoutContext) { |
|
877 |
this.layoutContext = layoutContext; |
|
878 |
} |
|
879 |
|
|
880 |
public LayoutControl getLayoutControl() { |
|
881 |
return layoutControl; |
|
882 |
} |
|
883 |
|
|
884 |
public void setLayoutControl(LayoutControl layoutControl) { |
|
885 |
this.layoutControl = layoutControl; |
|
886 |
} |
|
852 | 887 |
} |
Also available in: Unified diff