Package org.apache.hop.core.gui
Class BasePainter<Hop extends BaseHopMeta<?>,Part extends IBaseMeta>
- java.lang.Object
-
- org.apache.hop.core.gui.BasePainter<Hop,Part>
-
- Direct Known Subclasses:
PipelinePainter,WorkflowPainter
public abstract class BasePainter<Hop extends BaseHopMeta<?>,Part extends IBaseMeta> extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected Pointareaprotected List<AreaOwner>areaOwnersprotected Hopcandidatestatic intCONTENT_MENU_INDENTstatic intCORNER_RADIUS_2static intCORNER_RADIUS_3static intCORNER_RADIUS_4static intCORNER_RADIUS_5protected booleandrawingEditIconsprotected IGcgcprotected RectanglegraphPortprotected intgridSizeprotected inticonSizeprotected intlineWidthprotected floatmagnificationprotected Pointmaximumstatic intMINI_ICON_DISTANCEstatic intMINI_ICON_MARGINstatic intMINI_ICON_SKEWstatic intMINI_ICON_TRIANGLE_BASEprotected intminiIconSizeprotected DPointoffsetprotected floatscreenMagnificationprotected RectangleselectionRectangleprotected booleanshowingNavigationViewprotected Objectsubjectdoublethetaprotected IVariablesvariablesprotected RectangleviewPortprotected doublezoomFactor
-
Constructor Summary
Constructors Constructor Description BasePainter(IGc gc, IVariables variables, Object subject, Point area, DPoint offset, Rectangle selectionRectangle, List<AreaOwner> areaOwners, int iconSize, int lineWidth, int gridSize, String noteFontName, int noteFontHeight, double zoomFactor, boolean drawingEditIcons)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected intcalcArrowLength()protected voiddrawArrow(IGc.EImage arrow, int[] line, Hop hop, Object startObject, Object endObject)protected abstract voiddrawArrow(IGc.EImage arrow, int x1, int y1, int x2, int y2, double theta, int size, double factor, Hop jobHop, Object startObject, Object endObject)protected voiddrawGrid()protected voiddrawNavigationView()Draw a small rectangle at the bottom right of the screen which depicts the viewport as a part of the total size of the metadata graph.protected voiddrawNote(NotePadMeta notePadMeta)protected voiddrawRect(Rectangle rect)PointgetArea()List<AreaOwner>getAreaOwners()HopgetCandidate()IGcgetGc()RectanglegetGraphPort()Gets graphPortintgetGridSize()intgetIconSize()protected int[]getLine(Part fs, Part ts)intgetLineWidth()floatgetMagnification()PointgetMaximum()Gets maximumintgetMiniIconSize()Gets miniIconSizeintgetNoteFontHeight()StringgetNoteFontName()DPointgetOffset()floatgetScreenMagnification()Gets screenMagnificationRectanglegetSelectionRectangle()static IGc.EImagegetStreamIconImage(StreamIcon streamIcon, boolean enabled)ObjectgetSubject()doublegetTheta()IVariablesgetVariables()Gets variablesRectanglegetViewPort()Gets viewPortdoublegetZoomFactor()Gets zoomFactorbooleanisDrawingEditIcons()Gets drawingEditIconsbooleanisShowingNavigationView()Gets showingNavigationViewprotected PointmagnifyPoint(Point p)protected Pointreal2screen(int x, int y)protected intround(double value)voidsetArea(Point area)voidsetAreaOwners(List<AreaOwner> areaOwners)voidsetCandidate(Hop candidate)voidsetDrawingEditIcons(boolean drawingEditIcons)voidsetGc(IGc gc)voidsetGraphPort(Rectangle graphPort)Sets graphPortvoidsetGridSize(int gridSize)voidsetIconSize(int iconSize)voidsetLineWidth(int lineWidth)voidsetMagnification(float magnification)voidsetMaximum(Point maximum)Sets maximumvoidsetMiniIconSize(int miniIconSize)voidsetNoteFontHeight(int noteFontHeight)voidsetNoteFontName(String noteFontName)voidsetOffset(DPoint offset)voidsetScreenMagnification(float screenMagnification)Sets screenMagnificationvoidsetSelectionRectangle(Rectangle selectionRectangle)voidsetShowingNavigationView(boolean showingNavigationView)Sets showingNavigationViewvoidsetSubject(Object subject)voidsetVariables(IVariables variables)Sets variablesvoidsetViewPort(Rectangle viewPort)Sets viewPortvoidsetZoomFactor(double zoomFactor)
-
-
-
Field Detail
-
theta
public final double theta
-
MINI_ICON_MARGIN
public static final int MINI_ICON_MARGIN
- See Also:
- Constant Field Values
-
MINI_ICON_TRIANGLE_BASE
public static final int MINI_ICON_TRIANGLE_BASE
- See Also:
- Constant Field Values
-
MINI_ICON_DISTANCE
public static final int MINI_ICON_DISTANCE
- See Also:
- Constant Field Values
-
MINI_ICON_SKEW
public static final int MINI_ICON_SKEW
- See Also:
- Constant Field Values
-
CONTENT_MENU_INDENT
public static final int CONTENT_MENU_INDENT
- See Also:
- Constant Field Values
-
CORNER_RADIUS_5
public static final int CORNER_RADIUS_5
- See Also:
- Constant Field Values
-
CORNER_RADIUS_4
public static final int CORNER_RADIUS_4
- See Also:
- Constant Field Values
-
CORNER_RADIUS_3
public static final int CORNER_RADIUS_3
- See Also:
- Constant Field Values
-
CORNER_RADIUS_2
public static final int CORNER_RADIUS_2
- See Also:
- Constant Field Values
-
drawingEditIcons
protected boolean drawingEditIcons
-
zoomFactor
protected double zoomFactor
-
area
protected Point area
-
offset
protected DPoint offset
-
iconSize
protected int iconSize
-
miniIconSize
protected int miniIconSize
-
gridSize
protected int gridSize
-
selectionRectangle
protected Rectangle selectionRectangle
-
lineWidth
protected int lineWidth
-
magnification
protected float magnification
-
subject
protected Object subject
-
variables
protected IVariables variables
-
gc
protected IGc gc
-
candidate
protected Hop extends BaseHopMeta<?> candidate
-
maximum
protected Point maximum
-
showingNavigationView
protected boolean showingNavigationView
-
screenMagnification
protected float screenMagnification
-
graphPort
protected Rectangle graphPort
-
viewPort
protected Rectangle viewPort
-
-
Method Detail
-
getStreamIconImage
public static IGc.EImage getStreamIconImage(StreamIcon streamIcon, boolean enabled)
-
drawNote
protected void drawNote(NotePadMeta notePadMeta)
-
real2screen
protected Point real2screen(int x, int y)
-
drawRect
protected void drawRect(Rectangle rect)
-
drawGrid
protected void drawGrid()
-
round
protected int round(double value)
-
calcArrowLength
protected int calcArrowLength()
-
getMagnification
public float getMagnification()
- Returns:
- the magnification
-
setMagnification
public void setMagnification(float magnification)
- Parameters:
magnification- the magnification to set
-
getArea
public Point getArea()
-
setArea
public void setArea(Point area)
-
getOffset
public DPoint getOffset()
-
setOffset
public void setOffset(DPoint offset)
-
getIconSize
public int getIconSize()
-
setIconSize
public void setIconSize(int iconSize)
-
getGridSize
public int getGridSize()
-
setGridSize
public void setGridSize(int gridSize)
-
getSelectionRectangle
public Rectangle getSelectionRectangle()
-
setSelectionRectangle
public void setSelectionRectangle(Rectangle selectionRectangle)
-
getLineWidth
public int getLineWidth()
-
setLineWidth
public void setLineWidth(int lineWidth)
-
getSubject
public Object getSubject()
-
setSubject
public void setSubject(Object subject)
-
getGc
public IGc getGc()
-
setGc
public void setGc(IGc gc)
-
getNoteFontName
public String getNoteFontName()
-
setNoteFontName
public void setNoteFontName(String noteFontName)
-
getNoteFontHeight
public int getNoteFontHeight()
-
setNoteFontHeight
public void setNoteFontHeight(int noteFontHeight)
-
getTheta
public double getTheta()
-
getCandidate
public Hop getCandidate()
-
setCandidate
public void setCandidate(Hop candidate)
-
drawArrow
protected void drawArrow(IGc.EImage arrow, int[] line, Hop hop, Object startObject, Object endObject) throws HopException
- Throws:
HopException
-
drawArrow
protected abstract void drawArrow(IGc.EImage arrow, int x1, int y1, int x2, int y2, double theta, int size, double factor, Hop jobHop, Object startObject, Object endObject) throws HopException
- Throws:
HopException
-
drawNavigationView
protected void drawNavigationView()
Draw a small rectangle at the bottom right of the screen which depicts the viewport as a part of the total size of the metadata graph. If the graph fits completely on the screen, the navigation view is not shown.
-
getZoomFactor
public double getZoomFactor()
Gets zoomFactor- Returns:
- value of zoomFactor
-
setZoomFactor
public void setZoomFactor(double zoomFactor)
- Parameters:
zoomFactor- The zoomFactor to set
-
isDrawingEditIcons
public boolean isDrawingEditIcons()
Gets drawingEditIcons- Returns:
- value of drawingEditIcons
-
setDrawingEditIcons
public void setDrawingEditIcons(boolean drawingEditIcons)
- Parameters:
drawingEditIcons- The drawingEditIcons to set
-
getMiniIconSize
public int getMiniIconSize()
Gets miniIconSize- Returns:
- value of miniIconSize
-
setMiniIconSize
public void setMiniIconSize(int miniIconSize)
- Parameters:
miniIconSize- The miniIconSize to set
-
isShowingNavigationView
public boolean isShowingNavigationView()
Gets showingNavigationView- Returns:
- value of showingNavigationView
-
setShowingNavigationView
public void setShowingNavigationView(boolean showingNavigationView)
Sets showingNavigationView- Parameters:
showingNavigationView- value of showingNavigationView
-
getMaximum
public Point getMaximum()
Gets maximum- Returns:
- value of maximum
-
setMaximum
public void setMaximum(Point maximum)
Sets maximum- Parameters:
maximum- value of maximum
-
getVariables
public IVariables getVariables()
Gets variables- Returns:
- value of variables
-
setVariables
public void setVariables(IVariables variables)
Sets variables- Parameters:
variables- value of variables
-
getScreenMagnification
public float getScreenMagnification()
Gets screenMagnification- Returns:
- value of screenMagnification
-
setScreenMagnification
public void setScreenMagnification(float screenMagnification)
Sets screenMagnification- Parameters:
screenMagnification- value of screenMagnification
-
getGraphPort
public Rectangle getGraphPort()
Gets graphPort- Returns:
- value of graphPort
-
setGraphPort
public void setGraphPort(Rectangle graphPort)
Sets graphPort- Parameters:
graphPort- value of graphPort
-
getViewPort
public Rectangle getViewPort()
Gets viewPort- Returns:
- value of viewPort
-
setViewPort
public void setViewPort(Rectangle viewPort)
Sets viewPort- Parameters:
viewPort- value of viewPort
-
-