use of org.apache.pivot.wtk.Window in project pivot by apache.
the class WindowSkin method getPreferredHeight.
@Override
public int getPreferredHeight(int width) {
Window window = (Window) getComponent();
Component content = window.getContent();
return (content != null) ? content.getPreferredHeight(width) : 0;
}
use of org.apache.pivot.wtk.Window in project pivot by apache.
the class WindowSkin method getPreferredSize.
@Override
public Dimensions getPreferredSize() {
Window window = (Window) getComponent();
Component content = window.getContent();
return (content != null) ? content.getPreferredSize() : Dimensions.ZERO;
}
use of org.apache.pivot.wtk.Window in project pivot by apache.
the class WindowSkin method mouseDown.
@Override
public boolean mouseDown(Container container, Mouse.Button button, int x, int y) {
boolean consumed = super.mouseDown(container, button, x, y);
Window window = (Window) container;
window.moveToFront();
return consumed;
}
use of org.apache.pivot.wtk.Window in project pivot by apache.
the class WindowSkin method layout.
@Override
public void layout() {
Window window = (Window) getComponent();
Component content = window.getContent();
if (content != null) {
content.setSize(window.getSize());
}
}
use of org.apache.pivot.wtk.Window in project pivot by apache.
the class SwingDemo method createPivotFrame.
private static void createPivotFrame() {
// Create the internal frame that will contain the Pivot components
JInternalFrame internalFrame = new JInternalFrame("Pivot Components");
desktop.add(internalFrame);
// Create the display host
ApplicationContext.DisplayHost displayHost = new ApplicationContext.DisplayHost();
internalFrame.add(displayHost);
// Add the display to the display list
displays.add(displayHost.getDisplay());
// Load the Pivot window
BXMLSerializer bxmlSerializer = new BXMLSerializer();
Window window;
try {
window = (Window) bxmlSerializer.readObject(SwingDemo.class.getResource("pivot_window.bxml"));
} catch (IOException exception) {
throw new RuntimeException(exception);
} catch (SerializationException exception) {
throw new RuntimeException(exception);
}
// Open the Pivot window on the display
window.open(displayHost.getDisplay());
// Open and select the internal frame
internalFrame.setLocation(240, 100);
internalFrame.setSize(480, 360);
internalFrame.setVisible(true);
internalFrame.setResizable(true);
try {
internalFrame.setSelected(true);
} catch (PropertyVetoException exception) {
throw new RuntimeException(exception);
}
}
Aggregations