guitools.toolkit
Class EPeerImpl

java.lang.Object
  extended by TPeerImpl
      extended by guitools.toolkit.EPeerImpl
All Implemented Interfaces:
EditablePeer

public class EPeerImpl
extends TPeerImpl
implements EditablePeer

An EPeerImpl class extends EPeerImpl and implements EditablePeer. After it is added EContainer or EditablePaintBoard, It can be edited by mouse or inspector.

See Also:
#TComponent, #EditablePeer

Field Summary
 
Fields inherited from interface guitools.toolkit.EditablePeer
ALLBLACKBLOCK, ALLCURPOS, BBHEIGHT, BBWIDTH, BOTTOMLEFTBB, BOTTOMLEFTCP, BOTTOMMIDDLEBB, BOTTOMRIGHTBB, BOTTOMRIGHTCP, CENTERLEFTBB, CENTERRIGHTBB, MOVABLE, NOBLACKBLOCK, NOCURPOS, TOPLEFTBB, TOPLEFTCP, TOPMIDDLEBB, TOPRIGHTBB, TOPRIGHTCP
 
Constructor Summary
EPeerImpl(java.awt.Component owner)
          Constructs.
 
Method Summary
 boolean canBeEdited()
          Checks object.
 boolean canBeEditedContent()
          Checks object.
 boolean canBeMultiSelect()
          Checks object.
 boolean canBeSelected()
          Checks object.
 int getCurPosMarks()
          Returns position marks value.
 int getEdCtrls()
          Returns editable areas in the editable component.
 Editable getEditable()
          Gets editable target.
 java.awt.Cursor getEditorCursor(int pos)
          Gets editor cursor, when this component is activted.
 java.lang.Object getOwner()
          Get internal data structure owner.
 int getStatus()
          Returns editable status.
 int inBlackBlock(int x, int y, int edctrl)
          Check the point parameter int x, int y in the editable black block.
 void paintExterior(java.awt.Graphics g, int width, int height, int edctrl)
          It is a callback method.
 void paintMarks(java.awt.Graphics g)
          Paints position marks at normal status.
 void propertiesChanged(PropertyAtomicDoAction propAct)
           
 void setCurPosMarks(int value)
          Sets position marks value with parameter int value.
 void setEditable(Editable ed)
          Sets editable component.
 void setOwner(java.lang.Object peer)
           
 void setStatus(int status)
          Sets editable status.
 void updateBoundsWithGrid()
          Update bounds according to grid.
 void updateEditableBounds()
          Updates editable target bounds with bound in the board.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EPeerImpl

public EPeerImpl(java.awt.Component owner)
Constructs. Create a new EPeerImpl object.

Method Detail

getStatus

public int getStatus()
Returns editable status. The status is one of the NORMAL, SELECTED, SEMISELECTED, ACTIVATED, EDITORCONTENTS or CURRENTNODE.


setStatus

public void setStatus(int status)
Sets editable status. The argument status is only one of the NORMAL, SELECTED, SEMISELECTED, ACTIVATED, EDITORCONTENTS or CURRENTNODE.


getEditable

public Editable getEditable()
Gets editable target. When the status isn't NORMAL, A Editalbe object in the EditablePaintBoard cover on it.

Specified by:
getEditable in interface EditablePeer

setEditable

public void setEditable(Editable ed)
Sets editable component.

Specified by:
setEditable in interface EditablePeer

updateEditableBounds

public void updateEditableBounds()
Updates editable target bounds with bound in the board.

Specified by:
updateEditableBounds in interface EditablePeer

getEdCtrls

public int getEdCtrls()
Returns editable areas in the editable component. There are nine editable areas in a editable component. User can set editable areas from zero to eight with setEditorControls method.

Specified by:
getEdCtrls in interface EditablePeer

getCurPosMarks

public int getCurPosMarks()
Returns position marks value. When an editable component is normal status, if returned value isn't NOMARK there are some small marks visible in the editable component corner. User can set position marks value from NOMARK to MARKALL of Editor with setPositionMarks method.

Specified by:
getCurPosMarks in interface EditablePeer

setCurPosMarks

public void setCurPosMarks(int value)
Sets position marks value with parameter int value. The parameter value only is value between NOMARK and MARKALL of Editor. Each vlaue of position marks TOPLEFTCP, TOPRIGHTCP, BOTTOMLEFTCP or BOTTOMRIGHTCP is a bit field. User can combine these values to a parameter.

Specified by:
setCurPosMarks in interface EditablePeer

paintExterior

public void paintExterior(java.awt.Graphics g,
                          int width,
                          int height,
                          int edctrl)
It is a callback method. Then editable component's status isn't normal the EditorTarget that this component holded call this method in its paint method.

Specified by:
paintExterior in interface EditablePeer

paintMarks

public void paintMarks(java.awt.Graphics g)
Paints position marks at normal status.

Specified by:
paintMarks in interface EditablePeer

inBlackBlock

public int inBlackBlock(int x,
                        int y,
                        int edctrl)
Check the point parameter int x, int y in the editable black block. The return value may be EditanblePeer.TOPLEFTBB, EditanblePeer.TOPMIDDLEBB, EditanblePeer.TOPRIGHTBB, EditanblePeer.CENTERLEFTBB, EditanblePeer.CENTERRIGHTBB, EditanblePeer.BOTTOMLEFTBB, EditanblePeer.BOTTOMMIDDLEBB, EditanblePeer.BOTTOMRIGHTBB, when the point in one of the black block. Otherwise return NOBLACKBLOCK.

Specified by:
inBlackBlock in interface EditablePeer

getEditorCursor

public java.awt.Cursor getEditorCursor(int pos)
Gets editor cursor, when this component is activted.

Specified by:
getEditorCursor in interface EditablePeer

updateBoundsWithGrid

public void updateBoundsWithGrid()
Update bounds according to grid.


canBeSelected

public boolean canBeSelected()
Checks object. If it can be selected return true. Otherwise return false.


canBeMultiSelect

public boolean canBeMultiSelect()
Checks object. If it can be multi-selected return true. Otherwise return false.


canBeEdited

public boolean canBeEdited()
Checks object. If it can be edited return true. Otherwise return false.

Specified by:
canBeEdited in interface EditablePeer

canBeEditedContent

public boolean canBeEditedContent()
Checks object. If it can edit contents return true. Otherwise return false.

Specified by:
canBeEditedContent in interface EditablePeer

setOwner

public void setOwner(java.lang.Object peer)

getOwner

public java.lang.Object getOwner()
Get internal data structure owner.


propertiesChanged

public void propertiesChanged(PropertyAtomicDoAction propAct)