|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.jfimagine.jfgraph.shape.base.AbstractObject
|
+--com.jfimagine.jfgraph.shape.union.JFPage
JFPage class. A page is a cad page, for multi-views of a cad graph design.
| Field Summary | |
static java.lang.String |
XML_DISABLEPORTSNAPPING
A XML string tag represents if disable or enable port snapping |
static java.lang.String |
XML_HIDEPORTS
A XML string tag represents if hide or show ports |
static java.lang.String |
XML_JFDRAW
A XML string tag represents a JFDraw xml file |
static java.lang.String |
XML_PAGE
A XML string tag represents a Page |
static java.lang.String |
XML_SCALEUNIT
A XML string tag represents a scale unit |
static java.lang.String |
XML_SCALEVALUE
A XML string tag represents a scale value |
static java.lang.String |
XML_SCREENUNIT
A XML string tag represents a screen unit |
| Fields inherited from class com.jfimagine.jfgraph.shape.base.AbstractObject |
m_lastError, XML_OBJECTID, XML_OBJECTTYPE |
| Constructor Summary | |
JFPage()
Constructor for Page |
|
| Method Summary | |
void |
addLayer(JFLayer layer)
Add a new layer to this page. |
protected void |
appendChildToDOM(Element element,
JFVersion version)
Append necessary xml child for current element, this method will be called internally by toDOM. |
int |
bindPorts(JFPoint mousePos)
bind ports at a specified point. |
void |
bringToFront(java.util.List objList)
Send a sub-collection of object list in current layer to back. |
void |
clearAccessTimes()
Clear access times, Clear all objects access times of current layer. |
java.lang.Object |
clone()
Creates a new object of the same class and with the same contents as this object. |
protected AbstractObject |
cloneMe()
Creates a new AbstractObject of the same class and with the same contents as this object. |
void |
draw(java.awt.Graphics g,
boolean isXorMode)
Draw current page on graphic canvas. |
boolean |
equals(java.lang.Object obj)
Determines whether or not two objects are equal. |
protected void |
extractChildFromDOM(Element element,
JFVersion version)
Extract needed xml child from current element, this method will be called internally by fromDOM. |
boolean |
finishLoadingImages(java.awt.Component canvas)
for loading an image, we need to call this finish loading image method to completely create a new image. |
java.lang.String |
getAuthor()
Get the author of this page. |
Rect |
getBounds()
Get the bounds of this page. |
CanvasFormat |
getCanvasFormat()
Get canvas format. |
JFLayer |
getCurrentLayer()
Get the current layer. |
int |
getCurrentLayerIndex()
Get the current layer index. |
JFLayer |
getLayer(int index)
Get a specified layer by index. |
JFLayer |
getLayerByObjectId(int objectId)
Get a specified layer by object id. |
java.util.List |
getLayerItemList()
Get layer items as check items, it's used to be modified by layer setup. |
ObjectList |
getLayerList()
Get the shape list. |
JFPageFormat |
getPageFormat()
Get page format. |
java.lang.String |
getProducer()
Get the producer of this page. |
int |
getScaleUnit()
Get the scale unit, a scale unit is something like << 1cm = 100 * [scaleUnit] >> |
double |
getScaleValue()
Get the scale value, a scale value is something like << 1cm = [scaleValue] * km >> |
int |
getScreenUnit()
Get the screen unit, a screen unit is something like << 1 * [screenUnit] = 1000 * meter >> We only allowed CM or INch for current screen unit. |
java.lang.String |
getVersion()
Get the version of this page. |
AbstractObject |
groupShapes(java.util.List objList)
Group a selection to one JFGroup object. |
int |
hashCode()
Returns the hashcode for this Object. |
void |
insertLayer(JFLayer layer,
int index)
Insert a new layer to this page. |
boolean |
isDisablePortSnapping()
if assigned disable port snapping. |
boolean |
isHidePorts()
if assigned hidding ports . |
boolean |
isModified()
if this page is modified. |
boolean |
loadFromBinary(java.lang.String fileName,
java.awt.Component c)
Load this page from a binary file. |
void |
loadFromStream(JFReader stream,
boolean skipHead,
JFVersion version)
Load object data from a binary stream |
boolean |
loadFromXML(java.lang.String fileName,
java.awt.Component c)
Load this page from an XML file. |
boolean |
loadFromXMLString(java.lang.String xmlString,
java.awt.Component c)
Load this page from an XML string.Attention: this xml string is already an xml document, but not the file name of an xml file. |
void |
newPage()
clear all data in this page, to create a complete new page. |
AbstractObject |
pickBy(java.awt.Graphics g,
JFPoint pnt)
pick up shape object by a position point. |
ObjectList |
pickBy(java.awt.Graphics g,
Rect rect)
pick up shape object by a rectangle. |
Port |
portIntersects(JFPoint pnt,
AbstractObject avoidParent)
Get which port of current shape that intersects with point pnt. |
java.util.List |
portIntersectsList(JFPoint pnt)
Get a ports list of alls hapes that intersects with point pnt. |
void |
removeLayer(int index)
Remove a specified layer. |
void |
removeLayerByObjectId(int objectId)
Remove a specified layer. |
void |
restoreLayerItemList(java.util.List itemList)
Restore layer items as item backuped in itemList. |
boolean |
saveToBinary(java.lang.String fileName)
Save this page to a binary file. |
void |
saveToStream(JFWriter stream,
JFVersion version)
Save this object to a binary stream |
boolean |
saveToXML(java.lang.String fileName)
Save this page to an XML file. |
java.lang.String |
saveToXMLString()
Save this page to an XML string. |
void |
sendToBack(java.util.List objList)
Send a sub-collection of object list in current layer to back. |
void |
setAuthor(java.lang.String author)
Set the author of this page. |
void |
setCurrentLayerIndex(int layerIndex)
Set the current layer index. |
void |
setDefaultLayerIndex()
Consider the default visible layer, then set current layer index on it. |
void |
setDisablePortSnapping(boolean disable)
set if hide or show ports. |
void |
setHidePorts(boolean hide)
set if hide or show ports. |
void |
setIsMetric(boolean isMetric)
set scale as metric or english measurement. |
void |
setLayerItemList(java.util.List itemList,
java.util.List removedItemList)
Set new layer items |
void |
setModified(boolean modified)
set if this page is modified or unmodified(when save/load). |
void |
setScaleUnit(int unit)
Set the scale unit |
void |
setScaleValue(double scale)
Set the scale value |
void |
setScreenUnit(int unit)
Set the screen unit We only allowed CM or INch for current screen unit. |
void |
setShowDesign(boolean showDesign)
set if show or hide current object's design info |
void |
setValue(AbstractObject obj)
Set value by a new object. |
void |
setZoomScale(double zoomScale)
set zoom scale |
java.lang.String |
toString()
Convert this object to String |
int |
unbindPorts(JFPoint mousePos)
unbind ports at a specified point. |
java.util.List |
ungroupShapes(java.util.List objList)
Ungroup a selection to individual objects. |
| Methods inherited from class com.jfimagine.jfgraph.shape.base.AbstractObject |
fromDOM, getLastError, getMaxObjectId, getObjectId, getObjectType, getXMLTag, getZoomScale, isShowDesign, setLastError, setObjectId, setObjectType, setXMLTag, toDOM |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String XML_JFDRAW
public static final java.lang.String XML_PAGE
public static final java.lang.String XML_HIDEPORTS
public static final java.lang.String XML_DISABLEPORTSNAPPING
public static final java.lang.String XML_SCALEVALUE
public static final java.lang.String XML_SCALEUNIT
public static final java.lang.String XML_SCREENUNIT
| Constructor Detail |
public JFPage()
| Method Detail |
public void newPage()
public java.lang.String getVersion()
public java.lang.String getProducer()
public java.lang.String getAuthor()
public void setAuthor(java.lang.String author)
author - A new author.public boolean isModified()
public void setModified(boolean modified)
public boolean isHidePorts()
public void setHidePorts(boolean hide)
public boolean isDisablePortSnapping()
public void setDisablePortSnapping(boolean disable)
public double getScaleValue()
public void setScaleValue(double scale)
scale - A new scale valuepublic int getScaleUnit()
public void setScaleUnit(int unit)
unit - A new scale unitpublic int getScreenUnit()
public void setScreenUnit(int unit)
unit - A new screen unitpublic void setIsMetric(boolean isMetric)
isMetric - True if is metric, false english.public ObjectList getLayerList()
public JFPageFormat getPageFormat()
public CanvasFormat getCanvasFormat()
public Rect getBounds()
public JFLayer getCurrentLayer()
public int getCurrentLayerIndex()
public void setCurrentLayerIndex(int layerIndex)
public void setDefaultLayerIndex()
public void setValue(AbstractObject obj)
setValue in class AbstractObject
public void draw(java.awt.Graphics g,
boolean isXorMode)
g - A graphic canvas.isXorMode - If is in xor mode now.public void setShowDesign(boolean showDesign)
setShowDesign in class AbstractObject
public AbstractObject pickBy(java.awt.Graphics g,
JFPoint pnt)
g - A graphics context used to pick some graphics sensitive shapes(e.g. label)pnt - A JFPoint that intersect or contained in an AbstractObject.
public ObjectList pickBy(java.awt.Graphics g,
Rect rect)
g - A graphics context used to pick some graphics sensitive shapes(e.g. label)rect - A Rect that intersects or contains one or move AbstractObjects.
public Port portIntersects(JFPoint pnt,
AbstractObject avoidParent)
pnt - A JFPoint used to test intersection.avoidParent - A specified avoided parent to avoid connected to self.
public java.util.List portIntersectsList(JFPoint pnt)
pnt - A JFPoint used to test intersection.
public AbstractObject groupShapes(java.util.List objList)
objList - a sub collection of this object list.
public java.util.List ungroupShapes(java.util.List objList)
objList - a collection of grouped objects.
public void clearAccessTimes()
public void setZoomScale(double zoomScale)
setZoomScale in class AbstractObjectzoomScale - A new zoom scale.public int bindPorts(JFPoint mousePos)
mousePos - Current mouse position.
public int unbindPorts(JFPoint mousePos)
mousePos - Current mouse position.
public void sendToBack(java.util.List objList)
public void bringToFront(java.util.List objList)
public void insertLayer(JFLayer layer,
int index)
layer - A new layerindex - A index position for insertion.public void addLayer(JFLayer layer)
layer - A new layerpublic JFLayer getLayer(int index)
index - The index of a layer.public JFLayer getLayerByObjectId(int objectId)
objectId - The object id of a layer.public void removeLayer(int index)
index - The index of a layer.public void removeLayerByObjectId(int objectId)
public java.util.List getLayerItemList()
public void restoreLayerItemList(java.util.List itemList)
itemList - A layer items list backuped.
public void setLayerItemList(java.util.List itemList,
java.util.List removedItemList)
itemList - item list that is modifiedremovedItemList - item list that is removed.public java.lang.String toString()
toString in class AbstractObject
protected AbstractObject cloneMe()
throws java.lang.CloneNotSupportedException
cloneMe in class AbstractObjectjava.lang.CloneNotSupportedException
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class AbstractObjectjava.lang.CloneNotSupportedExceptionpublic int hashCode()
hashCode in class AbstractObjectpublic boolean equals(java.lang.Object obj)
equals in class AbstractObjectobj - an object to be compared with this object
public boolean saveToXML(java.lang.String fileName)
fileName - A file name.public java.lang.String saveToXMLString()
protected void appendChildToDOM(Element element,
JFVersion version)
appendChildToDOM in class AbstractObjectversion - A file version notification so this object can obey the rules to save data.element - A XML element to append child xml nodes
public boolean loadFromXML(java.lang.String fileName,
java.awt.Component c)
fileName - A file name.c - A component used to help loading some special objects, e.g. image.
public boolean loadFromXMLString(java.lang.String xmlString,
java.awt.Component c)
xmlString - An xml string.c - A component used to help loading some special objects, e.g. image.
protected void extractChildFromDOM(Element element,
JFVersion version)
extractChildFromDOM in class AbstractObjectelement - An element used to extract needed xml childversion - A file version notification so this object can obey the rules to fetch data.public boolean saveToBinary(java.lang.String fileName)
fileName - A file name.
public void saveToStream(JFWriter stream,
JFVersion version)
throws java.io.IOException
saveToStream in class AbstractObjectstream - An binary output streamversion - A file version notification so this object can obey the rules to save data.
java.io.IOException
public boolean loadFromBinary(java.lang.String fileName,
java.awt.Component c)
fileName - A file name.c - A component used to help loading some special objects, e.g. image.
public void loadFromStream(JFReader stream,
boolean skipHead,
JFVersion version)
throws java.io.IOException
loadFromStream in class AbstractObjectstream - An binary input streamskipHead - Skip head 'TYPE' check, an shape object should always
has its own shape-type stored, if this shape-type has already been readed,
this loadFromStream should/could not read the type anymore.version - A file version notification so this object can obey the rules to fetch data.
java.io.IOExceptionpublic boolean finishLoadingImages(java.awt.Component canvas)
canvas - A component for creating an image object.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||