Package com.iizix.prop.ui.device
Class GSimpleDevice
java.lang.Object
com.iizix.prop.ui.device.GSimpleDevice
Class for a simple panel device, i.e. without orientation, device pixel ratio, etc.
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- static final GSimpleDeviceThe browser device has size 0.- static final GSimpleDeviceThe iPad device in landscape mode.- static final GSimpleDeviceThe iPad device in portrait mode.- static final GSimpleDeviceThe iPhone 5 device (or iPhone SE) in landscape mode.- static final GSimpleDeviceThe iPhone 5 device (or iPhone SE) in portrait mode.- static final GSimpleDeviceThe panel part has the size of the panel part container.
- Constructor SummaryConstructorsConstructorDescription- GSimpleDevice- (ReadTransaction trans) Constructs the device from a transaction.- GSimpleDevice- (String string) Creates from a string representation "width={integer},height={integer},canChangeOrientation={boolean},name".- GSimpleDevice- (String name, int pixelX, int pixelY) Constructs the device.- GSimpleDevice- (String name, int pixelX, int pixelY, boolean canChangeOrientation) Constructs the device.
- Method SummaryModifier and TypeMethodDescription- void- append- (SendTransaction trans) Appends the device to a transaction.- booleanChecks if orientation can be changed.Creates a new simple device with changed orientation type (portrait/landscape).The data string representation.- booleanCompares two devices.- booleanCompares two devices without caring about orientation.- intGets the height.- getName()Gets the name of the device.- int- getWidth()Gets the width.- int- hashCode()The hash code.- booleanChecks if the device is the browser device.- booleanGets the orientation.- booleanChecks if the device is for a panel part.- booleanGets the orientation.- toString()Returns a string representation of this class instance and its values.
- Field Details- BROWSERThe browser device has size 0.
- PANEL_PARTThe panel part has the size of the panel part container.
- IPHONE5_LANDSCAPEThe iPhone 5 device (or iPhone SE) in landscape mode.
- IPHONE5_PORTRAITThe iPhone 5 device (or iPhone SE) in portrait mode.
- IPAD_LANDSCAPEThe iPad device in landscape mode.
- IPAD_PORTRAITThe iPad device in portrait mode.
 
- Constructor Details- GSimpleDeviceConstructs the device.- Parameters:
- name- The device name.
- pixelX- The pixel size in X.
- pixelY- The pixel size in Y.
- Throws:
- NullPointerException- If the name is null.
- IllegalArgumentException- For illegal definitions.
 
- GSimpleDeviceConstructs the device.- Parameters:
- name- The device name.
- pixelX- The pixel size in X.
- pixelY- The pixel size in Y.
- Throws:
- NullPointerException- If the name is null.
- IllegalArgumentException- For illegal definitions.
 
- GSimpleDeviceCreates from a string representation "width={integer},height={integer},canChangeOrientation={boolean},name".- Parameters:
- string- The string.
- Throws:
- IllegalArgumentException- For illegal definitions.
- NumberFormatException- For value errors.
- NoSuchElementException- For format errors.
 
- GSimpleDeviceConstructs the device from a transaction.
 
- Method Details- isBrowserpublic boolean isBrowser()Checks if the device is the browser device.
- isPanelPartpublic boolean isPanelPart()Checks if the device is for a panel part.
- appendAppends the device to a transaction.
- getNameGets the name of the device.
- isPortraitpublic boolean isPortrait()Gets the orientation.- Returns:
- true if it's portrait sized.
 
- isLandscapepublic boolean isLandscape()Gets the orientation.- Returns:
- true if it's landscape sized.
 
- getWidthpublic int getWidth()Gets the width.- Returns:
- A value for pixels in HTML.
 
- getHeightpublic int getHeight()Gets the height.- Returns:
- A value for pixels in HTML.
 
- equalsCompares two devices.
- hashCodepublic int hashCode()The hash code.
- equalsNoOrientationCompares two devices without caring about orientation.- Parameters:
- d- The device to compare with.
- Returns:
- true if equal.
 
- dataToStringThe data string representation.
- toStringReturns a string representation of this class instance and its values.
- canChangeOrientationpublic boolean canChangeOrientation()Checks if orientation can be changed.- Returns:
- Some devices do not support orientation changes, e.g. a TV.
 
- changeOrientationCreates a new simple device with changed orientation type (portrait/landscape).- Returns:
- The new simple device if not same width and height, otherwise it's the same instance.