Package org.oddjob.arooa.design.view
Class ScreenPresence
java.lang.Object
org.oddjob.arooa.design.view.ScreenPresence
- All Implemented Interfaces:
Serializable
Represent location and size information for a screen
component.
- Author:
- rob
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptionstatic ScreenPresence.AtPointatLocation(int x, int y) static ScreenPresenceProvide a screen presence the default size for the current screen.static ScreenPresencedefaultSize(Dimension screenSize) Create a screen presence the default size within the give dimensions.booleanGet the location of this screen presence.getSize()Get the size of this screen presence.inthashCode()booleanIs this screen presence currently on any screen currently attached.locationToCenter(Dimension size) Return the location relative to this screen area that would centre something of the given size within this screen area.static ScreenPresenceCreate a screen presence the size of the given component.static ScreenPresence.OfSizeofSize(int width, int height) resize(double factor) Create ScreenPresence a factor the size of this.voidFit a component to the location and size of this screen presence.toString()
-
Method Details
-
atLocation
-
ofSize
-
resize
Fit a component to the location and size of this screen presence.- Parameters:
component- The componennt.
-
getLocation
Get the location of this screen presence.- Returns:
- The location. Never null.
-
getSize
Get the size of this screen presence.- Returns:
- The size. Never null.
-
locationToCenter
Return the location relative to this screen area that would centre something of the given size within this screen area. If the width of the component is wider than this screen presence it will be positioned at the left of this screen presences. If the height is greater than this screen presence it will be positioned at the top of this screen presence.- Parameters:
size- The size of the thing to position.- Returns:
- The position of the thing to be centered relative to this screen presence.
-
resize
Create ScreenPresence a factor the size of this. The location will be adjusted so that it is offset equally in both x and y direction from this ScreenPresence.- Parameters:
factor- The factor to size the new ScreenPresence by.- Returns:
- A new screen presence resized relative to this one.
-
isOnAnyScreen
public boolean isOnAnyScreen()Is this screen presence currently on any screen currently attached. When working on a laptop that is moved between docking stations a screen presence that was visible may now not be.- Returns:
- True if this screen presence top left location is on any screen.
-
of
Create a screen presence the size of the given component.- Parameters:
component- The component to create a screen presence from.- Returns:
- A screen presence. Never null.
-
defaultSize
Create a screen presence the default size within the give dimensions.- Parameters:
screenSize- The dimensions in which to fit the default screen presence.- Returns:
- A screen presence fitting within the given screen size.
-
defaultSize
Provide a screen presence the default size for the current screen.- Returns:
- A new screen presence. Never null.
-
equals
-
hashCode
public int hashCode() -
toString
-