sk.uniba.euromath.editor.xmlEditor.policies
Class FigureSelectionPolicy

java.lang.Object
  extended by org.eclipse.gef.editpolicies.AbstractEditPolicy
      extended by org.eclipse.gef.editpolicies.GraphicalEditPolicy
          extended by org.eclipse.gef.editpolicies.SelectionEditPolicy
              extended by sk.uniba.euromath.editor.xmlEditor.policies.FigureSelectionPolicy
All Implemented Interfaces:
org.eclipse.gef.EditPolicy, org.eclipse.gef.RequestConstants

public class FigureSelectionPolicy
extends org.eclipse.gef.editpolicies.SelectionEditPolicy

Responsible for handling selection border

Author:
Martin Kollar 10.9.2005

Field Summary
static int SELECION_BORDER_WIDTH
          constant that gives width of the selection rectangle
 
Fields inherited from interface org.eclipse.gef.EditPolicy
COMPONENT_ROLE, CONNECTION_BENDPOINTS_ROLE, CONNECTION_ENDPOINTS_ROLE, CONNECTION_ROLE, CONTAINER_ROLE, DIRECT_EDIT_ROLE, GRAPHICAL_NODE_ROLE, LAYOUT_ROLE, NODE_ROLE, PRIMARY_DRAG_ROLE, SELECTION_FEEDBACK_ROLE, TREE_CONTAINER_ROLE
 
Fields inherited from interface org.eclipse.gef.RequestConstants
REQ_ADD, REQ_ALIGN, REQ_ALIGN_CHILDREN, REQ_CLONE, REQ_CONNECTION_END, REQ_CONNECTION_START, REQ_CREATE, REQ_CREATE_BENDPOINT, REQ_DELETE, REQ_DELETE_DEPENDANT, REQ_DIRECT_EDIT, REQ_MOVE, REQ_MOVE_BENDPOINT, REQ_MOVE_CHILDREN, REQ_OPEN, REQ_ORPHAN, REQ_ORPHAN_CHILDREN, REQ_RECONNECT_SOURCE, REQ_RECONNECT_TARGET, REQ_RESIZE, REQ_RESIZE_CHILDREN, REQ_SELECTION, REQ_SELECTION_HOVER
 
Constructor Summary
FigureSelectionPolicy()
          Construcotr.
FigureSelectionPolicy(boolean showHighlight)
           
 
Method Summary
protected  org.eclipse.draw2d.IFigure createFeedBack()
           
 void eraseTargetFeedback(org.eclipse.gef.Request request)
           
 org.eclipse.gef.EditPart getTargetEditPart(org.eclipse.gef.Request request)
           
protected  void hideSelection()
           
protected  void showHighlight()
          Highlights host - figure associated with editpart where policy is installed.
protected  void showSelection()
           
 void showTargetFeedback(org.eclipse.gef.Request request)
          Shows the selection feedback
 
Methods inherited from class org.eclipse.gef.editpolicies.SelectionEditPolicy
activate, addSelectionListener, deactivate, hideFocus, removeSelectionListener, setFocus, setSelectedState, showFocus, showPrimarySelection
 
Methods inherited from class org.eclipse.gef.editpolicies.GraphicalEditPolicy
addFeedback, getFeedbackLayer, getHostFigure, getLayer, removeFeedback
 
Methods inherited from class org.eclipse.gef.editpolicies.AbstractEditPolicy
debugFeedback, eraseSourceFeedback, getCommand, getHost, setHost, showSourceFeedback, toString, understandsRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SELECION_BORDER_WIDTH

public static final int SELECION_BORDER_WIDTH
constant that gives width of the selection rectangle

See Also:
Constant Field Values
Constructor Detail

FigureSelectionPolicy

public FigureSelectionPolicy()
Construcotr. Creates new policy.


FigureSelectionPolicy

public FigureSelectionPolicy(boolean showHighlight)
Parameters:
showHighlight - if true then host is highlighted when cursor of mouse is over host
Method Detail

createFeedBack

protected org.eclipse.draw2d.IFigure createFeedBack()
Returns:
Figure that is selection border

eraseTargetFeedback

public void eraseTargetFeedback(org.eclipse.gef.Request request)
Specified by:
eraseTargetFeedback in interface org.eclipse.gef.EditPolicy
Overrides:
eraseTargetFeedback in class org.eclipse.gef.editpolicies.AbstractEditPolicy
Parameters:
request - not need to be SelectionRequest

getTargetEditPart

public org.eclipse.gef.EditPart getTargetEditPart(org.eclipse.gef.Request request)
Specified by:
getTargetEditPart in interface org.eclipse.gef.EditPolicy
Overrides:
getTargetEditPart in class org.eclipse.gef.editpolicies.SelectionEditPolicy
Parameters:
request -
Returns:
host or null

hideSelection

protected void hideSelection()
Specified by:
hideSelection in class org.eclipse.gef.editpolicies.SelectionEditPolicy

showHighlight

protected void showHighlight()
Highlights host - figure associated with editpart where policy is installed.


showSelection

protected void showSelection()
Specified by:
showSelection in class org.eclipse.gef.editpolicies.SelectionEditPolicy

showTargetFeedback

public void showTargetFeedback(org.eclipse.gef.Request request)
Shows the selection feedback

Specified by:
showTargetFeedback in interface org.eclipse.gef.EditPolicy
Overrides:
showTargetFeedback in class org.eclipse.gef.editpolicies.AbstractEditPolicy
Parameters:
request - should by SelectionRequest


Copyright © 2003-2006 null. All Rights Reserved.