Rational Developer for Power Systems Software
V7.6

com.ibm.etools.systems.application.visual.editor.srcinfo.ui.figures
Class SourceContainerFigure

java.lang.Object
  extended by NodeFigure
      extended by com.ibm.etools.systems.application.visual.editor.ui.figures.impl.AbstractFeedbackNodeFigure
          extended by com.ibm.etools.systems.application.visual.editor.ui.figures.impl.AbstractCollapsableFigure
              extended by com.ibm.etools.systems.application.visual.editor.srcinfo.ui.figures.SourceContainerFigure
All Implemented Interfaces:
ICollapsableArtifactFigure, IFeedbackFigure, INamedFigure

public class SourceContainerFigure
extends AbstractCollapsableFigure
implements INamedFigure

Source Container figure.


Field Summary
 int arcHeight_inner
           
 int arcHeight_outer
           
 int arcWidth_inner
           
 int arcWidth_outer
           
 Color background_gradient
           
 int childrenPane_top_padding
           
protected  boolean collapse
           
 Image collapsedTwistieImage
           
 int collapseImage_height
           
 int collapseImage_shiftX
           
 int collapseImage_shiftY
           
 int collapseImage_width
           
 int collapseLine_fill_gap
           
 int collapseLine_gap
           
 Rectangle collapseToggleArea
           
static String copyright
           
 RGB defaultInnerLineColor
           
 RGB defaultOuterLineColor
           
 Image expandTwistieImage
           
 Color foreground_gradient
           
 int inner_item_gap
           
 int max_outer_borderline_width
           
 int min_childrenPane_height
           
 int min_childrenPane_width
           
 int outer_inner_bottom_gap
           
 int outer_inner_left_gap
           
 int outer_inner_right_gap
           
 int outer_inner_top_gap
           
 int outerBorderLineStyle
           
 int outerBorderLineWidth
           
 int outerRectangle_shiftX
           
 int outerRectangle_shiftY
           
 int shapeImage_height
           
 int shapeImage_width
           
 int titleLabel_left_padding
           
 int titleLabel_right_padding
           
 int titleLabel_top_padding
           
 
Fields inherited from class com.ibm.etools.systems.application.visual.editor.ui.figures.impl.AbstractCollapsableFigure
collapsed, hasCollapsedFigure
 
Fields inherited from class com.ibm.etools.systems.application.visual.editor.ui.figures.impl.AbstractFeedbackNodeFigure
editPart, feedbackStateManager, mapMode
 
Fields inherited from interface com.ibm.etools.systems.application.visual.editor.ui.figures.IFeedbackFigure
STATE_ASSOCIATED_CLEAR, STATE_ASSOCIATED_SOURCE, STATE_ASSOCIATED_TARGET, STATE_HOVER, STATE_NONE, STATE_SELECTED, STATE_TARGET, STATE_TARGET_HOVER
 
Constructor Summary
SourceContainerFigure(Image shapeImage, String shapeTitle, IMapMode mapMode, IGraphicalEditPart editPart)
          Collapsable figure for source container.
 
Method Summary
 void cleanUp()
          Clean up resources.
protected  void drawOuterBorder(Graphics graphics, Rectangle outRect, String feedbackState)
          Draw outer border for this figure according to the current state.
protected  IFigure getChildrenPane()
          Get children Pane.
protected  Rectangle getCollapseIconArea()
          Return the rectangle where collapsable toggler icon is.
 IFigure getContentPane()
          Get content pane
 Rectangle getFeedbackFigureBounds()
          Return feedback figure bound.
 Rectangle getHandleBounds()
          Returns the Rectangle around which handles are to be placed.
protected  IconRetriever getIconRetriever()
          Get icon retriever.
protected  Image getImage(String id, String size)
          Get image.
 WrappingLabel getNameLabel()
          Get name label.
protected  IFigure getTitlePane()
          Get title Pane.
protected  Image getToggleImage(boolean isCollapsed)
          Return collapse twistie image.
protected  void init()
          Initialize the figure.
 void invalidate()
           
protected  void paintCollapseImageArea(Rectangle collapseImgRect, Graphics graphics)
          Paint toggle area.
protected  void paintFigure(Graphics graphics)
          Paint figure.
 boolean requireCollapseableTwistie()
          Return true if there is at least two collapseable children figures, false otherwise.
 void setCollapsedImage(Image collapsedImage)
          Set collpase twistie image.
 void setExpandedImage(Image expandedImage)
          Set expand twistie image.
 void setFillColor(RGB shapeFillRGB)
          Set fill color
 void setFont(Font newFont)
          Set the font.
 void setFontColor(Color color)
          Set Font color.
 void setForegroundColor(Color color)
          Set ForegroundColor.
 void setGradientBackgroundColor(Color backgroundColor)
          Set background color for gradient
 void setGradientForegroundColor(Color foregroundColor)
          Set foreground color for gradient
 void setInnerLineColor(RGB innerLineRGB)
          Set line color that is used in inner rectangle border.
 void setOutBorderLineStyle(int lineStyle)
          Set line style of outer border
 void setOutBorderLineWidth(int lineWidth)
          Set line style of outer border
 void setOutLineColor(RGB outerLineRGB)
          Set line color that is used in outer rectangle border.
protected  void setupChildrenPane()
          Setup children pane
protected  void setupDefaultColors()
          Setup default colors
protected  void setupLayout()
          Setup layout.
protected  void setupTitlePane()
          Setup title pane.
 
Methods inherited from class com.ibm.etools.systems.application.visual.editor.ui.figures.impl.AbstractCollapsableFigure
getInitialCollapseState, initCollapseState, isCollapsed, isCollapseIconArea, setCollapsed
 
Methods inherited from class com.ibm.etools.systems.application.visual.editor.ui.figures.impl.AbstractFeedbackNodeFigure
blendColor, getAssociatedSourceColor, getAssociatedTargetColor, getFeedbackState, setFeedbackState, setFeedbackStateManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static String copyright

shapeImage_width

public int shapeImage_width

shapeImage_height

public int shapeImage_height

arcWidth_outer

public int arcWidth_outer

arcHeight_outer

public int arcHeight_outer

outerRectangle_shiftX

public int outerRectangle_shiftX

outerRectangle_shiftY

public int outerRectangle_shiftY

max_outer_borderline_width

public int max_outer_borderline_width

outerBorderLineStyle

public int outerBorderLineStyle

outerBorderLineWidth

public int outerBorderLineWidth

arcWidth_inner

public int arcWidth_inner

arcHeight_inner

public int arcHeight_inner

outer_inner_top_gap

public int outer_inner_top_gap

outer_inner_left_gap

public int outer_inner_left_gap

outer_inner_right_gap

public int outer_inner_right_gap

outer_inner_bottom_gap

public int outer_inner_bottom_gap

inner_item_gap

public int inner_item_gap

collapseImage_shiftX

public int collapseImage_shiftX

collapseImage_shiftY

public int collapseImage_shiftY

collapseImage_width

public int collapseImage_width

collapseImage_height

public int collapseImage_height

collapseToggleArea

public Rectangle collapseToggleArea

collapsedTwistieImage

public Image collapsedTwistieImage

expandTwistieImage

public Image expandTwistieImage

collapseLine_gap

public int collapseLine_gap

collapseLine_fill_gap

public int collapseLine_fill_gap

titleLabel_top_padding

public int titleLabel_top_padding

titleLabel_left_padding

public int titleLabel_left_padding

titleLabel_right_padding

public int titleLabel_right_padding

childrenPane_top_padding

public int childrenPane_top_padding

min_childrenPane_width

public int min_childrenPane_width

min_childrenPane_height

public int min_childrenPane_height

foreground_gradient

public Color foreground_gradient

background_gradient

public Color background_gradient

defaultOuterLineColor

public RGB defaultOuterLineColor

defaultInnerLineColor

public RGB defaultInnerLineColor

collapse

protected boolean collapse
Constructor Detail

SourceContainerFigure

public SourceContainerFigure(Image shapeImage,
                             String shapeTitle,
                             IMapMode mapMode,
                             IGraphicalEditPart editPart)
Collapsable figure for source container.

Method Detail

init

protected void init()
Initialize the figure.


setupTitlePane

protected void setupTitlePane()
Setup title pane. The title pane will hold : 1. shape title The shape image will be drawn directly in painFigure method. This method also uses MarginBorder as border to position itself in the layout of container.


setupChildrenPane

protected void setupChildrenPane()
Setup children pane


getTitlePane

protected IFigure getTitlePane()
Get title Pane.


getChildrenPane

protected IFigure getChildrenPane()
Get children Pane.


getContentPane

public IFigure getContentPane()
Get content pane


setupLayout

protected void setupLayout()
Setup layout.


setupDefaultColors

protected void setupDefaultColors()
Setup default colors


paintFigure

protected void paintFigure(Graphics graphics)
Paint figure.


drawOuterBorder

protected void drawOuterBorder(Graphics graphics,
                               Rectangle outRect,
                               String feedbackState)
Draw outer border for this figure according to the current state.

Parameters:
graphics -
outRect -
feedbackState2 -

setFillColor

public void setFillColor(RGB shapeFillRGB)
Set fill color

Parameters:
shapeFillRGB -

setOutLineColor

public void setOutLineColor(RGB outerLineRGB)
Set line color that is used in outer rectangle border.

Parameters:
outerLineRGB: - given color of outer line.

setInnerLineColor

public void setInnerLineColor(RGB innerLineRGB)
Set line color that is used in inner rectangle border.

Parameters:
innerLineRGB: - given color of outer line.

setGradientForegroundColor

public void setGradientForegroundColor(Color foregroundColor)
Set foreground color for gradient


setGradientBackgroundColor

public void setGradientBackgroundColor(Color backgroundColor)
Set background color for gradient


requireCollapseableTwistie

public boolean requireCollapseableTwistie()
Return true if there is at least two collapseable children figures, false otherwise. The return value will be used to decide if we need to draw collapseable image twistie.


setOutBorderLineStyle

public void setOutBorderLineStyle(int lineStyle)
Set line style of outer border


setOutBorderLineWidth

public void setOutBorderLineWidth(int lineWidth)
Set line style of outer border


getHandleBounds

public Rectangle getHandleBounds()
Returns the Rectangle around which handles are to be placed. The Rectangle should be in the same coordinate system as the figure itself.

Returns:
The rectangle used for handles
See Also:
org.eclipse.gef.handles.HandleBounds

getToggleImage

protected Image getToggleImage(boolean isCollapsed)
Return collapse twistie image.


setCollapsedImage

public void setCollapsedImage(Image collapsedImage)
Set collpase twistie image.


setExpandedImage

public void setExpandedImage(Image expandedImage)
Set expand twistie image.


paintCollapseImageArea

protected void paintCollapseImageArea(Rectangle collapseImgRect,
                                      Graphics graphics)
Paint toggle area.


getFeedbackFigureBounds

public Rectangle getFeedbackFigureBounds()
Description copied from interface: IFeedbackFigure
Return feedback figure bound.

Specified by:
getFeedbackFigureBounds in interface IFeedbackFigure
Specified by:
getFeedbackFigureBounds in class AbstractFeedbackNodeFigure

setForegroundColor

public void setForegroundColor(Color color)
Set ForegroundColor.


setFontColor

public void setFontColor(Color color)
Set Font color.


getNameLabel

public WrappingLabel getNameLabel()
Description copied from interface: INamedFigure
Get name label.

Specified by:
getNameLabel in interface INamedFigure

invalidate

public void invalidate()
See Also:
IFigure#invalidate()

getCollapseIconArea

protected Rectangle getCollapseIconArea()
Description copied from class: AbstractCollapsableFigure
Return the rectangle where collapsable toggler icon is.

Specified by:
getCollapseIconArea in class AbstractCollapsableFigure

cleanUp

public void cleanUp()
Clean up resources.


getImage

protected Image getImage(String id,
                         String size)
Get image.

Parameters:
id - id string used in image registry.
size - size of image

getIconRetriever

protected IconRetriever getIconRetriever()
Get icon retriever.


setFont

public void setFont(Font newFont)
Set the font.


Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.