public class DefaultLayoutContext extends Object implements LayoutContext
Modifier and Type | Field and Description |
---|---|
static String |
PERSISTENCE_DEFINITION_NAME |
Constructor and Description |
---|
DefaultLayoutContext()
Create a new object of LayoutContext.
|
Modifier and Type | Method and Description |
---|---|
void |
addFFrame(IFFrame frame,
boolean clearSelection,
boolean select)
It adds a fframe to Arraylist of FFrames .
|
void |
addFFrameSameProperties(IFFrame frame)
It adds a fframe to Arraylist of FFrames with the same properties.
|
void |
addObserver(Observer o) |
void |
addTocObserver(TocModelObserver observer) |
void |
clearSelection()
Clear the selection of FFrames.
|
Iterator |
deepiterator()
Get an Iterator over al elements in the layout.
|
void |
deleteObserver(Observer o) |
void |
deleteObservers() |
void |
delFFrame(IFFrame frame)
Remove the fframe of parameter.
|
void |
delFFrame(int index)
Remove the fframe of index.
|
void |
delFFrameSelected()
Remove the fframes selected.
|
void |
fullRefresh()
Refresh all FFrames of Layout.
|
IFFrame[] |
getAllFFrames()
It returns all the fframes included them erased and modified in all its
previous forms.
|
AffineTransform |
getAT()
Returns the AffineTransform that is applying in the Layout.
|
Attributes |
getAttributes()
It returns the print attributes of the Layout.
|
IFFrame |
getFFrame(int i)
It obtains the FFrame from an index.
|
IFFrame[] |
getFFrames()
It obtains the Array with all the FFrames that have been added al Layout.
|
FrameCommandsRecord |
getFrameCommandsRecord()
Returns the EditableFeatureSource, is the control of all change in the
FFrames of Layout.
|
int |
getNumBefore()
Returns other number before the current fframes.
|
int |
getNumBehind()
Returns other number behind the current fframes.
|
boolean |
getRuler()
Returns if is shown or not the rule of the Layout.
|
IFFrame[] |
getSelectedFFrames()
Gets the list of selected FFrames
|
<T> T[] |
getSelectedFFrames(Class<T> clazz)
Gets the list of selected FFrames that are instance of the provided
Class.
|
MapContext |
getTocModel()
Gets the model of the TOC.
|
boolean |
hasDocBeenOpened()
True when the document window has been opened at least once, false otherwise.
|
boolean |
isAdjustingToGrid()
It returns if has been applying in the fframes that are added to Layout
the grid, or not.
|
boolean |
isEditable()
It returns if the Layout is in edition.
|
boolean |
isGridVisible()
It returns if has been showing the grid of Layout, or not.
|
Iterator |
iterator() |
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
notifAllObservers()
Call all LayoutDrawListeners.
|
void |
notifyTocUpdated(TocModelChangedNotification.Type type)
Triggers a notification to the TocModel observers of type
TocModelChangedNotification#MODEL_CHANGED |
static void |
registerPersistent() |
void |
removeTocObserver(TocModelObserver observer) |
void |
removeTocObservers() |
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setAdjustToGrid(boolean b)
It inserts if has been applying in the fframes that are added to Layout
the grid, or not.
|
void |
setAtributes(Attributes attributes)
Inserts the print attributes of Layout.
|
void |
setEditable(boolean b)
It inserts if the Layout is in edition.
|
void |
setGridVisible(boolean b)
It inserts if draws the Grid in the Layout or not.
|
void |
setHasDocBeenOpened(boolean hasBeenOpened)
True when the document window has been opened at least once, false otherwise.
|
void |
setNumBefore(int numBefore) |
void |
setNumBehind(int numBehind) |
void |
setRuler(boolean b)
It inserts if is shown or not the rule of the Layout.
|
void |
setTocModel(MapContext tocModel)
Sets the model of the TOC.
|
void |
updateFFrames()
It orders the FFrames depending on its position specified by level.
|
public static final String PERSISTENCE_DEFINITION_NAME
public DefaultLayoutContext()
public AffineTransform getAT()
LayoutContext
getAT
in interface LayoutContext
public Attributes getAttributes()
LayoutContext
getAttributes
in interface LayoutContext
public void setAtributes(Attributes attributes)
LayoutContext
setAtributes
in interface LayoutContext
attributes
- Attributes.public IFFrame[] getFFrames()
LayoutContext
getFFrames
in interface LayoutContext
public IFFrame getFFrame(int i)
LayoutContext
getFFrame
in interface LayoutContext
public void updateFFrames()
LayoutContext
updateFFrames
in interface LayoutContext
public void delFFrameSelected()
LayoutContext
delFFrameSelected
in interface LayoutContext
public void clearSelection()
LayoutContext
clearSelection
in interface LayoutContext
public void delFFrame(int index)
LayoutContext
delFFrame
in interface LayoutContext
public void delFFrame(IFFrame frame)
LayoutContext
delFFrame
in interface LayoutContext
frame
- FFrame to remove.public FrameCommandsRecord getFrameCommandsRecord()
LayoutContext
getFrameCommandsRecord
in interface LayoutContext
public void addFFrame(IFFrame frame, boolean clearSelection, boolean select)
LayoutContext
addFFrame
in interface LayoutContext
frame
- fframe to add.clearSelection
- True True if clean the selection of the fframes
already added and false if intends to maintain the same selection.select
- Boolean that indicates if has to remain selected the FFrame
that is added or not.public void addFFrameSameProperties(IFFrame frame)
LayoutContext
addFFrameSameProperties
in interface LayoutContext
frame
- fframe to add.public int getNumBehind()
LayoutContext
getNumBehind
in interface LayoutContext
public int getNumBefore()
LayoutContext
getNumBefore
in interface LayoutContext
public IFFrame[] getAllFFrames()
LayoutContext
getAllFFrames
in interface LayoutContext
public Iterator deepiterator()
LayoutContext
deepiterator
in interface LayoutContext
public Iterator iterator()
iterator
in interface LayoutContext
public IFFrame[] getSelectedFFrames()
LayoutContext
getSelectedFFrames
in interface LayoutContext
public <T> T[] getSelectedFFrames(Class<T> clazz)
LayoutContext
getSelectedFFrames
in interface LayoutContext
clazz
- A classpublic boolean isEditable()
LayoutContext
isEditable
in interface LayoutContext
public void setEditable(boolean b)
LayoutContext
setEditable
in interface LayoutContext
b
- True if Layout is in edition.public boolean isAdjustingToGrid()
LayoutContext
isAdjustingToGrid
in interface LayoutContext
public void setAdjustToGrid(boolean b)
LayoutContext
setAdjustToGrid
in interface LayoutContext
b
- true if has been applying the grid.public void setRuler(boolean b)
LayoutContext
setRuler
in interface LayoutContext
b
- True if is shown or not the rule of the Layout.public boolean getRuler()
LayoutContext
getRuler
in interface LayoutContext
public boolean isGridVisible()
LayoutContext
isGridVisible
in interface LayoutContext
public void setGridVisible(boolean b)
LayoutContext
setGridVisible
in interface LayoutContext
b
- True if draws the Grid in the Layout.public void fullRefresh()
LayoutContext
fullRefresh
in interface LayoutContext
public void notifAllObservers()
LayoutContext
notifAllObservers
in interface LayoutContext
public static void registerPersistent()
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
PersistenceException
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
PersistenceException
public void setNumBefore(int numBefore)
setNumBefore
in interface LayoutContext
public void setNumBehind(int numBehind)
setNumBehind
in interface LayoutContext
public void addObserver(Observer o)
addObserver
in interface Observable
public void deleteObserver(Observer o)
deleteObserver
in interface Observable
public void deleteObservers()
deleteObservers
in interface Observable
public void setTocModel(MapContext tocModel)
LayoutContext
setTocModel
in interface LayoutContext
public void notifyTocUpdated(TocModelChangedNotification.Type type)
LayoutContext
TocModelChangedNotification#MODEL_CHANGED
notifyTocUpdated
in interface LayoutContext
public MapContext getTocModel()
LayoutContext
getTocModel
in interface LayoutContext
public void addTocObserver(TocModelObserver observer)
addTocObserver
in interface LayoutContext
public void removeTocObserver(TocModelObserver observer)
removeTocObserver
in interface LayoutContext
public void removeTocObservers()
removeTocObservers
in interface LayoutContext
public boolean hasDocBeenOpened()
hasDocBeenOpened
in interface LayoutContext
public void setHasDocBeenOpened(boolean hasBeenOpened)
setHasDocBeenOpened
in interface LayoutContext