Package org.sikuli.guide
Class Visual
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- org.sikuli.guide.Visual
-
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Cloneable
- Direct Known Subclasses:
SxAnchor,SxArea,SxArrow,SxBracket,SxCallout,SxCircle,SxClickable,SxFlag,SxImage,SxRectangle,SxSpotlight,SxText
public class Visual extends JComponent implements Cloneable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVisual.Layout-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description Visual.LayoutcurrentLayoutstatic ColordefColorstatic ColordefColorBackstatic ColordefColorFramestatic ColordefColorFrontstatic ColordefColorTextstatic StringdefFontstatic intdefFontSizestatic intdefStrokebooleanhasChangedVisual.LayoutlayoutintPADDING_XintPADDING_Y-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
Constructor Summary
Constructors Constructor Description Visual()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Visualabove()Visualabove(int y)voidaddAnimation(org.sikuli.guide.NewAnimator anim)voidaddAnimationListener(org.sikuli.guide.AnimationListener listener)voidaddCircleAnimation(Point origin, float radius)voidaddFadeinAnimation()voidaddFadeoutAnimation()voidaddFollower(Visual sklComp)voidaddMoveAnimation(Point source, Point destination)voidaddResizeAnimation(Dimension currentSize, Dimension targetSize)voidaddSlideAnimation(Point destination, Visual.Layout side)voidanimationCompleted()Visualbelow()Visualbelow(int y)Objectclone()AnimatorcreateMoveAnimator(int dest_x, int dest_y)AnimatorcreateSlidingAnimator(int offset_x, int offset_y)RectanglegetActualBounds()intgetActualHeight()PointgetActualLocation()DimensiongetActualSize()intgetActualWidth()PointgetCenter()static StringgetColorHex(Color col)RectanglegetFollowerBounds()ArrayList<Visual>getFollowers()VisualgetLeader()RegiongetRegion()RegiongetTarget()StringgetText()booleanisAutoLayoutEnabled()booleanisAutoMoveEnabled()booleanisAutoResizeEnabled()booleanisAutoVisibilityEnabled()Visualleft()Visualleft(int x)voidmoveTo(Point targetLocation)voidmoveTo(Point targetLocation, org.sikuli.guide.AnimationListener listener)voidoffsetLocation(int x, int y)voidpaint(Graphics g)voidpaintPlain(Graphics g)voidpopin()voidpopout()voidremoveFollower(Visual comp)voidremoveFrom(Container container)voidremoveFromLeader()voidresizeTo(Dimension targetSize)Visualright()Visualright(int x)voidsetActualBounds(Rectangle actualBounds)voidsetActualLocation(int x, int y)voidsetActualLocation(Point location)voidsetActualSize(int width, int height)voidsetActualSize(Dimension actualSize)voidsetAutoLayoutEnabled(boolean autoLayoutEnabled)voidsetAutoMoveEnabled(boolean autoMoveEnabled)voidsetAutoResizeEnabled(boolean autoResizeEnabled)voidsetAutoVisibilityEnabled(boolean autoVisibilityEnabled)VisualsetColor(int r, int g, int b)set the front and back color as (r, g, b) integer arrayVisualsetColor(Color color)set the front and back colorVisualsetColors(int[] front, int[] back, int[] frame, int[] text)mainly for Jython layer: colors given as (r, g, b) integer arrayVisualsetColors(Color all, Color front, Color back, Color frame, Color text)set a Java Color for the component
not all components have all color optionsvoidsetEmphasisAnimation(Animator anim)voidsetEntranceAnimation(Animator anim)VisualsetFont(String font, int fontSize)VisualsetFontSize(int i)voidsetGuide(Guide g)voidsetHorizontalAlignmentWithRegion(Region region, float f)VisualsetLayout(Visual.Layout lo)VisualsetLocationRelative(Visual.Layout side)voidsetLocationRelativeToComponent(Visual leader)voidsetLocationRelativeToComponent(Visual comp, float relativeX, float relativeY)voidsetLocationRelativeToComponent(Visual comp, int offsetx, int offsety)voidsetLocationRelativeToComponent(Visual comp, Visual.Layout side)voidsetLocationRelativeToPoint(Point point, Visual.Layout side)VisualsetLocationRelativeToRegion(Region region, Visual.Layout side)voidsetMargin(int top, int left, int bottom, int right)VisualsetMaxWidth(int w)voidsetMovable(boolean movable)voidsetOffset(int offsetx, int offsety)voidsetOpacity(float opacity)VisualsetScale(float scale)voidsetShadow(int shadowSize, int shadowOffset)voidsetShadowDefault()VisualsetStroke(int stk)<RCPS> VisualsetTarget(RCPS target)VisualsetText(String text)VisualsetTextColor(int r, int g, int b)set text color as (r, g, b) integer arrayVisualsetTextColor(Color color)set the text colorvoidsetVerticalAlignmentWithRegion(Region region, float f)voidsetVisible(boolean visible)voidsetZoomLevel(float zoomLevel)voidstartAnimation()voidstopAnimation()StringtoString()voidupdateComponent()-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update, updateUI
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
hasChanged
public boolean hasChanged
-
PADDING_X
public int PADDING_X
-
PADDING_Y
public int PADDING_Y
-
layout
public Visual.Layout layout
-
currentLayout
public Visual.Layout currentLayout
-
defColor
public static Color defColor
-
defColorFront
public static Color defColorFront
-
defColorBack
public static Color defColorBack
-
defColorFrame
public static Color defColorFrame
-
defColorText
public static Color defColorText
-
defStroke
public static int defStroke
-
defFont
public static String defFont
-
defFontSize
public static int defFontSize
-
-
Method Detail
-
setGuide
public void setGuide(Guide g)
-
getTarget
public Region getTarget()
-
setScale
public Visual setScale(float scale)
-
setLayout
public Visual setLayout(Visual.Layout lo)
-
setColors
public Visual setColors(Color all, Color front, Color back, Color frame, Color text)
set a Java Color for the component
not all components have all color options- Parameters:
all- sets the color for all options (which have to be null in this case)front- sets the foreground colorback- sets the background colorframe- sets the color of the frametext- sets the color of the text- Returns:
- the component itself for dot-chaining
-
setColors
public Visual setColors(int[] front, int[] back, int[] frame, int[] text)
mainly for Jython layer: colors given as (r, g, b) integer array- Parameters:
front- sets the foreground colorback- sets the background colorframe- sets the color of the frametext- sets the color of the text- Returns:
- the component itself for dot-chaining
-
setColor
public Visual setColor(Color color)
set the front and back color- Parameters:
color-- Returns:
- the component itself
-
setColor
public Visual setColor(int r, int g, int b)
set the front and back color as (r, g, b) integer array- Returns:
- the component itself
-
setTextColor
public Visual setTextColor(Color color)
set the text color- Parameters:
color-- Returns:
- the component itself
-
setTextColor
public Visual setTextColor(int r, int g, int b)
set text color as (r, g, b) integer array- Returns:
- the component itself
-
setStroke
public Visual setStroke(int stk)
-
setFontSize
public Visual setFontSize(int i)
-
setMaxWidth
public Visual setMaxWidth(int w)
-
getText
public String getText()
-
setAutoLayoutEnabled
public void setAutoLayoutEnabled(boolean autoLayoutEnabled)
-
isAutoLayoutEnabled
public boolean isAutoLayoutEnabled()
-
setAutoResizeEnabled
public void setAutoResizeEnabled(boolean autoResizeEnabled)
-
isAutoResizeEnabled
public boolean isAutoResizeEnabled()
-
setAutoMoveEnabled
public void setAutoMoveEnabled(boolean autoMoveEnabled)
-
isAutoMoveEnabled
public boolean isAutoMoveEnabled()
-
setAutoVisibilityEnabled
public void setAutoVisibilityEnabled(boolean autoVisibilityEnabled)
-
isAutoVisibilityEnabled
public boolean isAutoVisibilityEnabled()
-
getActualBounds
public Rectangle getActualBounds()
-
getRegion
public Region getRegion()
-
setActualBounds
public void setActualBounds(Rectangle actualBounds)
-
getCenter
public Point getCenter()
-
getActualSize
public Dimension getActualSize()
-
setActualSize
public void setActualSize(int width, int height)
-
setActualSize
public void setActualSize(Dimension actualSize)
-
getActualWidth
public int getActualWidth()
-
getActualHeight
public int getActualHeight()
-
getActualLocation
public Point getActualLocation()
-
offsetLocation
public void offsetLocation(int x, int y)
-
setActualLocation
public void setActualLocation(Point location)
-
setActualLocation
public void setActualLocation(int x, int y)
-
setMargin
public void setMargin(int top, int left, int bottom, int right)
-
setOffset
public void setOffset(int offsetx, int offsety)
-
setZoomLevel
public void setZoomLevel(float zoomLevel)
-
setMovable
public void setMovable(boolean movable)
-
setOpacity
public void setOpacity(float opacity)
-
updateComponent
public void updateComponent()
-
paintPlain
public void paintPlain(Graphics g)
-
paint
public void paint(Graphics g)
- Overrides:
paintin classJComponent
-
setShadowDefault
public void setShadowDefault()
-
setShadow
public void setShadow(int shadowSize, int shadowOffset)
-
addAnimation
public void addAnimation(org.sikuli.guide.NewAnimator anim)
-
addCircleAnimation
public void addCircleAnimation(Point origin, float radius)
-
addFadeinAnimation
public void addFadeinAnimation()
-
addFadeoutAnimation
public void addFadeoutAnimation()
-
addSlideAnimation
public void addSlideAnimation(Point destination, Visual.Layout side)
-
startAnimation
public void startAnimation()
-
stopAnimation
public void stopAnimation()
-
createSlidingAnimator
public Animator createSlidingAnimator(int offset_x, int offset_y)
-
createMoveAnimator
public Animator createMoveAnimator(int dest_x, int dest_y)
-
resizeTo
public void resizeTo(Dimension targetSize)
-
moveTo
public void moveTo(Point targetLocation)
-
moveTo
public void moveTo(Point targetLocation, org.sikuli.guide.AnimationListener listener)
-
popin
public void popin()
-
popout
public void popout()
-
setEntranceAnimation
public void setEntranceAnimation(Animator anim)
-
setEmphasisAnimation
public void setEmphasisAnimation(Animator anim)
-
addAnimationListener
public void addAnimationListener(org.sikuli.guide.AnimationListener listener)
-
animationCompleted
public void animationCompleted()
-
left
public Visual left()
-
left
public Visual left(int x)
-
right
public Visual right()
-
right
public Visual right(int x)
-
above
public Visual above()
-
above
public Visual above(int y)
-
below
public Visual below()
-
below
public Visual below(int y)
-
setTarget
public <RCPS> Visual setTarget(RCPS target)
-
setLocationRelative
public Visual setLocationRelative(Visual.Layout side)
-
setLocationRelativeToComponent
public void setLocationRelativeToComponent(Visual comp, Visual.Layout side)
-
setLocationRelativeToComponent
public void setLocationRelativeToComponent(Visual comp, int offsetx, int offsety)
-
setLocationRelativeToComponent
public void setLocationRelativeToComponent(Visual comp, float relativeX, float relativeY)
-
setLocationRelativeToComponent
public void setLocationRelativeToComponent(Visual leader)
-
setLocationRelativeToPoint
public void setLocationRelativeToPoint(Point point, Visual.Layout side)
-
setLocationRelativeToRegion
public Visual setLocationRelativeToRegion(Region region, Visual.Layout side)
-
setHorizontalAlignmentWithRegion
public void setHorizontalAlignmentWithRegion(Region region, float f)
-
setVerticalAlignmentWithRegion
public void setVerticalAlignmentWithRegion(Region region, float f)
-
removeFromLeader
public void removeFromLeader()
-
addFollower
public void addFollower(Visual sklComp)
-
setVisible
public void setVisible(boolean visible)
- Overrides:
setVisiblein classJComponent
-
getLeader
public Visual getLeader()
-
removeFollower
public void removeFollower(Visual comp)
-
getFollowerBounds
public Rectangle getFollowerBounds()
-
removeFrom
public void removeFrom(Container container)
-
-