public class Page extends java.lang.Object implements WorkspaceWidget, SearchableContainer, ISupportMemento
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_ABSTRACT_HEIGHT
The default abstract height
|
| Constructor and Description |
|---|
Page(Workspace workspace,
java.lang.String name)
Constructs a new Page
|
Page(Workspace workspace,
java.lang.String name,
int pageWidth,
int pageHeight,
java.lang.String pageDrawer)
Constructs a new Page
|
Page(Workspace workspace,
java.lang.String name,
int pageWidth,
int pageHeight,
java.lang.String pageDrawer,
boolean inFullview,
java.awt.Color defaultColor,
boolean isCollapsible) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBlock(RenderableBlock block)
Adds the specified block to this widget interally and graphically.
|
void |
addBlocks(java.util.Collection<RenderableBlock> blocks)
Adds a collection of blocks to this widget internally and graphically.
|
void |
addLoadedBlocks(java.util.Collection<RenderableBlock> loadedBlocks,
boolean importingPage) |
void |
addPixelWidth(int deltaPixelWidth) |
void |
blockDragged(RenderableBlock block)
Called by RenderableBlocks as they are dragged over this Widget.
|
void |
blockDropped(RenderableBlock block)
Called by RenderableBlocks that get "dropped" onto this Widget
|
void |
blockEntered(RenderableBlock block)
Called when a RenderableBlock is being dragged and goes from being
outside this Widget to being inside the Widget.
|
void |
blockExited(RenderableBlock block)
Called when a RenderableBlock that was being dragged over this Widget
goes from being inside this Widget to being outside the Widget.
|
void |
clearPage()
Destructs this Page by setting its set of blocks to empty.
|
boolean |
contains(int x,
int y)
Widgets must be able to report whether a given point is inside them
|
boolean |
contains(java.awt.Point p) |
void |
disableMinimize() |
void |
enableMinimize() |
double |
getAbstractHeight() |
double |
getAbstractWidth() |
static Page |
getBlankPage(Workspace workspace)
Constructs a new Page
|
java.util.Collection<RenderableBlock> |
getBlocks()
Returns the set of blocks that abstract "lives" inside this widget.
|
java.awt.Color |
getDefaultPageColor() |
java.awt.Image |
getIcon() |
javax.swing.JComponent |
getJComponent()
Very Java Swing dependent method
|
java.awt.Color |
getPageColor() |
java.lang.String |
getPageDrawer() |
java.lang.String |
getPageId()
Returns this page's id.
|
java.lang.String |
getPageName() |
RBParent |
getRBParent() |
org.w3c.dom.Node |
getSaveNode(org.w3c.dom.Document document) |
java.lang.Iterable<RenderableBlock> |
getSearchableElements()
Returns all of the searchable elements within this Searchable.
|
java.lang.Object |
getState() |
java.util.Collection<RenderableBlock> |
getTopLevelBlocks() |
static double |
getZoomLevel() |
boolean |
isInFullview() |
java.util.ArrayList<RenderableBlock> |
loadPageFrom(org.w3c.dom.Node pageNode,
boolean importingPage) |
void |
loadState(java.lang.Object memento) |
void |
reformBlockOrdering() |
void |
reformBlockPosition(RenderableBlock block) |
int |
reformBounds(double pixelXCor) |
void |
reformMinimumPixelWidth() |
void |
removeBlock(RenderableBlock block)
Used by RenderableBlocks to tell their originating Widgets that
they're moving somewhere else and so should be removed.
|
void |
reset()
TODO: THIS METHOD NOT YET DOCUMENTED OR IMPLEMENTED
Removes all the RenderableBlock content of this.
|
void |
setHide(boolean hide) |
void |
setIcon(java.awt.Image image) |
void |
setPageColor(java.awt.Color newColor) |
void |
setPageId(java.lang.String id)
Sets the page id.
|
void |
setPageName(java.lang.String newName) |
void |
setPixelWidth(int pixelWidth) |
static void |
setZoomLevel(double newZoom) |
java.lang.String |
toString()
Returns string representation of this
|
void |
updateContainsSearchResults(boolean containsSearchResults)
Called by the search bar to update the Searchable of whether it currently belongs to
the search bar's results.
|
public static final int DEFAULT_ABSTRACT_HEIGHT
public Page(Workspace workspace, java.lang.String name, int pageWidth, int pageHeight, java.lang.String pageDrawer)
name - - name of this page (this.name)pageWidth - - the abstract width of this page (this.width)pageHeight - - the abstract height of this page (this.height)pageDrawer - - the name of the page drawer that this page refers topublic Page(Workspace workspace, java.lang.String name, int pageWidth, int pageHeight, java.lang.String pageDrawer, boolean inFullview, java.awt.Color defaultColor, boolean isCollapsible)
public Page(Workspace workspace, java.lang.String name)
workspace - The workspace in usename - - name of this page (this.name)public void disableMinimize()
public void enableMinimize()
public void setHide(boolean hide)
public static Page getBlankPage(Workspace workspace)
workspace - The workspace in usepublic void reset()
public void clearPage()
public void setPageId(java.lang.String id)
public java.util.Collection<RenderableBlock> getBlocks()
WorkspaceWidgetgetBlocks in interface WorkspaceWidgetpublic java.util.Collection<RenderableBlock> getTopLevelBlocks()
public java.lang.String getPageId()
public java.lang.String getPageName()
public java.awt.Color getPageColor()
public java.awt.Color getDefaultPageColor()
public double getAbstractWidth()
public double getAbstractHeight()
public java.lang.String getPageDrawer()
public java.awt.Image getIcon()
public boolean isInFullview()
public void setPageName(java.lang.String newName)
newName - - the new name of this page.public void setIcon(java.awt.Image image)
image - - the new icon of this. May be nullpublic void setPageColor(java.awt.Color newColor)
newColor - - the new color of this pagepublic void addPixelWidth(int deltaPixelWidth)
deltaPixelWidth - public void setPixelWidth(int pixelWidth)
public int reformBounds(double pixelXCor)
pixelXCor - - the new X location of page's JComponent in terms of pixelspublic void reformBlockPosition(RenderableBlock block)
block - - the new block being added whose position must be revalidatedpublic void reformMinimumPixelWidth()
public void reformBlockOrdering()
public static void setZoomLevel(double newZoom)
newZoom - - the new zoom levelpublic static double getZoomLevel()
public void blockDropped(RenderableBlock block)
WorkspaceWidgetblockDropped in interface WorkspaceWidgetblock - the RenderableBlock that is "dropped" onto this Widgetpublic void blockDragged(RenderableBlock block)
WorkspaceWidgetblockDragged in interface WorkspaceWidgetblock - the RenderableBlock being draggedpublic void blockEntered(RenderableBlock block)
WorkspaceWidgetblockEntered in interface WorkspaceWidgetblock - the RenderableBlock being draggedpublic void blockExited(RenderableBlock block)
WorkspaceWidgetblockExited in interface WorkspaceWidgetblock - the RenderableBlock being draggedpublic void addBlock(RenderableBlock block)
WorkspaceWidgetaddBlock in interface WorkspaceWidgetblock - the desired RenderableBlock to add to thispublic void addBlocks(java.util.Collection<RenderableBlock> blocks)
WorkspaceWidgetaddBlocks in interface WorkspaceWidgetblocks - the Collection of RenderableBlocks to addpublic void removeBlock(RenderableBlock block)
WorkspaceWidgetremoveBlock in interface WorkspaceWidgetblock - the RenderableBlockpublic javax.swing.JComponent getJComponent()
WorkspaceWidgetgetJComponent in interface WorkspaceWidgetpublic RBParent getRBParent()
public boolean contains(int x,
int y)
WorkspaceWidgetcontains in interface WorkspaceWidgetpublic boolean contains(java.awt.Point p)
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Iterable<RenderableBlock> getSearchableElements()
SearchableContainergetSearchableElements in interface SearchableContainerpublic void updateContainsSearchResults(boolean containsSearchResults)
SearchableContainerupdateContainsSearchResults in interface SearchableContainercontainsSearchResults - true when the SearchableContainer is part of the current results.public java.util.ArrayList<RenderableBlock> loadPageFrom(org.w3c.dom.Node pageNode, boolean importingPage)
public void addLoadedBlocks(java.util.Collection<RenderableBlock> loadedBlocks, boolean importingPage)
public org.w3c.dom.Node getSaveNode(org.w3c.dom.Document document)
public java.lang.Object getState()
getState in interface ISupportMementopublic void loadState(java.lang.Object memento)
loadState in interface ISupportMemento