de.cau.cs.kieler.core.model.graphiti
Class GraphitiHighlightEffect

java.lang.Object
  extended by de.cau.cs.kieler.core.kivi.AbstractEffect
      extended by de.cau.cs.kieler.core.model.graphiti.GraphitiHighlightEffect
All Implemented Interfaces:
IEffect

public class GraphitiHighlightEffect
extends AbstractEffect

A simple transient highlighting effect. Can change line colors, line styles, and line widths for Shapes and NodeFigures.

Rating red

Constructor Summary
GraphitiHighlightEffect(EObject eObject, org.eclipse.graphiti.ui.editor.DiagramEditor editor)
          Create a new instance for the given edit part using the given color.
GraphitiHighlightEffect(EObject eObject, org.eclipse.graphiti.ui.editor.DiagramEditor editor, Color highlightColor)
          Create a new instance for the given edit part using the given color.
GraphitiHighlightEffect(EObject eObject, org.eclipse.graphiti.ui.editor.DiagramEditor editor, Color highlightColor, boolean children)
          Create a new instance for the given edit part using the given color.
GraphitiHighlightEffect(EObject eObject, org.eclipse.graphiti.ui.editor.DiagramEditor editor, Color highlightColor, Color background)
          Create a new instance for the given edit part using the given color.
GraphitiHighlightEffect(EObject eObject, org.eclipse.graphiti.ui.editor.DiagramEditor editor, Color highlightColor, Color background, boolean children)
          Create a new instance for the given edit part using the given color.
GraphitiHighlightEffect(EObject eObject, org.eclipse.graphiti.ui.editor.DiagramEditor editor, Color highlightColor, Color background, int lineStyle)
          Create a new instance for the given edit part using the given color.
GraphitiHighlightEffect(EObject eObject, org.eclipse.graphiti.ui.editor.DiagramEditor editor, Color highlightColor, int lineStyle)
          Create a new instance for the given edit part using the given color.
GraphitiHighlightEffect(EObject eObject, org.eclipse.graphiti.ui.editor.DiagramEditor editor, int lineStyle)
          Create a new instance for the given edit part using the given color.
 
Method Summary
 void execute()
          Execute the effect.
 boolean isMergeable()
          Determines whether this effect can be merged with previously scheduled effects.
 IEffect merge(IEffect other)
          Merge this effect with another effect.
 void setChangeWidth(boolean change)
          Specify whether the outline width is increased during highlight or not.
 void setColor(Color c)
          Set the color to use for highlighting.
 void setWidthIncrease(int newIncrease)
          Set the line width increase.
 void setWidthMaximum(int newMaximum)
          Set the maximum line width.
 void undo()
          Attempt to undo the effect.
 
Methods inherited from class de.cau.cs.kieler.core.kivi.AbstractEffect
schedule, scheduleUndo, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphitiHighlightEffect

public GraphitiHighlightEffect(EObject eObject,
                               org.eclipse.graphiti.ui.editor.DiagramEditor editor)
Create a new instance for the given edit part using the given color.

Parameters:
eObject - the EObject to highlight
editor - the editor to highlight in

GraphitiHighlightEffect

public GraphitiHighlightEffect(EObject eObject,
                               org.eclipse.graphiti.ui.editor.DiagramEditor editor,
                               int lineStyle)
Create a new instance for the given edit part using the given color.

Parameters:
eObject - the EObject to highlight
editor - the editor to highlight in
lineStyle - the line style to use for borders (black/white mode)

GraphitiHighlightEffect

public GraphitiHighlightEffect(EObject eObject,
                               org.eclipse.graphiti.ui.editor.DiagramEditor editor,
                               Color highlightColor,
                               int lineStyle)
Create a new instance for the given edit part using the given color.

Parameters:
eObject - the EObject to highlight
editor - the editor to highlight in
highlightColor - the color to use for highlighting
lineStyle - the line style to use for borders (black/white mode)

GraphitiHighlightEffect

public GraphitiHighlightEffect(EObject eObject,
                               org.eclipse.graphiti.ui.editor.DiagramEditor editor,
                               Color highlightColor,
                               Color background,
                               int lineStyle)
Create a new instance for the given edit part using the given color.

Parameters:
eObject - the EObject to highlight
editor - the editor to highlight in
highlightColor - the color to use for highlighting
background - the color to use for painting the background
lineStyle - the line style to use for borders (black/white mode)

GraphitiHighlightEffect

public GraphitiHighlightEffect(EObject eObject,
                               org.eclipse.graphiti.ui.editor.DiagramEditor editor,
                               Color highlightColor)
Create a new instance for the given edit part using the given color.

Parameters:
eObject - the EObject to highlight
editor - the editor to highlight in
highlightColor - the color to highlight the state with

GraphitiHighlightEffect

public GraphitiHighlightEffect(EObject eObject,
                               org.eclipse.graphiti.ui.editor.DiagramEditor editor,
                               Color highlightColor,
                               Color background)
Create a new instance for the given edit part using the given color.

Parameters:
eObject - the EObject to highlight
editor - the editor to highlight in
highlightColor - the color to highlight the state with
background - the color to use for painting the background

GraphitiHighlightEffect

public GraphitiHighlightEffect(EObject eObject,
                               org.eclipse.graphiti.ui.editor.DiagramEditor editor,
                               Color highlightColor,
                               boolean children)
Create a new instance for the given edit part using the given color.

Parameters:
eObject - the EObject to highlight
editor - the editor to highlight in
highlightColor - the color to highlight the state with
children - true if labels should be highlighted in the given color as well

GraphitiHighlightEffect

public GraphitiHighlightEffect(EObject eObject,
                               org.eclipse.graphiti.ui.editor.DiagramEditor editor,
                               Color highlightColor,
                               Color background,
                               boolean children)
Create a new instance for the given edit part using the given color.

Parameters:
eObject - the EObject to highlight
editor - the editor to highlight in
highlightColor - the color to highlight the state with
background - the color to use for painting the background
children - true if labels should be highlighted in the given color as well
Method Detail

execute

public void execute()
Execute the effect.


undo

public void undo()
Description copied from class: AbstractEffect
Attempt to undo the effect.

Specified by:
undo in interface IEffect
Overrides:
undo in class AbstractEffect

setColor

public void setColor(Color c)
Set the color to use for highlighting.

Parameters:
c - the color

setChangeWidth

public void setChangeWidth(boolean change)
Specify whether the outline width is increased during highlight or not.

Parameters:
change - true if width shall be increased

setWidthIncrease

public void setWidthIncrease(int newIncrease)
Set the line width increase.

Parameters:
newIncrease - new line width increase in pixel

setWidthMaximum

public void setWidthMaximum(int newMaximum)
Set the maximum line width.

Parameters:
newMaximum - new maximum line width in pixel

isMergeable

public boolean isMergeable()
Description copied from class: AbstractEffect
Determines whether this effect can be merged with previously scheduled effects.

Specified by:
isMergeable in interface IEffect
Overrides:
isMergeable in class AbstractEffect
Returns:
true if it can be merged, false if no search through the effect queue is necessary

merge

public IEffect merge(IEffect other)
Description copied from class: AbstractEffect
Merge this effect with another effect. Will return null if the effects can not be merged.

Specified by:
merge in interface IEffect
Overrides:
merge in class AbstractEffect
Parameters:
other - the effect to merge with
Returns:
the newly merged effect, or null if no merge was possible.