Class CalloutInfo
The given component info is used to render a magnified image of the given component onto another image. For this to work, the rendering engine will need to know how to translate the component's location to that of the image space onto which the callout will be drawn. This is the purpose of requiring the 'destination component'. That component provides the bounds that will be used to move the component's relative position (which is relative to the components parent).
-
Constructor Summary
ConstructorsConstructorDescriptionCalloutInfo(Component destinationComponent, Component sourceComponent) Constructor for the destination component, the source component and the area that is to be captured.CalloutInfo(Component destinationComponent, Component sourceComponent, Rectangle clientShape) Constructor for the destination component, the source component and the area that is to be captured. -
Method Summary
Modifier and TypeMethodDescriptiondoublevoidMoves the given rectangle to the image destination space.voidmoveToImage(Rectangle r, ImageUtils.Padding padding) Moves the given rectangle to the image destination space.voidMoves the given rectangle to screen space.voidsetMagnification(double magnification)
-
Constructor Details
-
CalloutInfo
Constructor for the destination component, the source component and the area that is to be captured. This constructor will call out the entire shape of the given source component.The destination component needs to be the item that was captured in the screenshot. If you captured a window, then pass that window as the destination. If you captured a sub-component of a window, then pass that sub-component as the destination.
- Parameters:
destinationComponent- the component over which the image will be paintedsourceComponent- the component that contains the area that will be called out
-
CalloutInfo
public CalloutInfo(Component destinationComponent, Component sourceComponent, Rectangle clientShape) Constructor for the destination component, the source component and the area that is to be captured.The destination component needs to be the item that was captured in the screenshot. If you captured a window, then pass that window as the destination. If you captured a sub-component of a window, then pass that sub-component as the destination.
- Parameters:
destinationComponent- the component over which the image will be paintedsourceComponent- the component that contains the area that will be called outclientShape- the shape that will be called out
-
-
Method Details
-
setMagnification
public void setMagnification(double magnification) -
getMagnification
public double getMagnification() -
moveToImage
Moves the given rectangle to the image destination space. Clients use this to create new shapes using the client space and then move them to the image destination space.- Parameters:
r- the rectanglepadding- any padding around the destination image
-
moveToDestination
Moves the given rectangle to the image destination space. Clients use this to create new shapes using the client space. This destination space is not the same as the final image that will get created.- Parameters:
r- the rectangle
-
moveToScreen
Moves the given rectangle to screen space. Clients use this to create new shapes using the client space and then move them to the image destination space.- Parameters:
r- the rectangle
-
getBounds
-