use of org.apache.pivot.wtk.Component in project pivot by apache.
the class TerraPaletteSkin method getPreferredSize.
@Override
public Dimensions getPreferredSize() {
int preferredWidth = 0;
int preferredHeight = 0;
Palette palette = (Palette) getComponent();
Component content = palette.getContent();
Dimensions preferredTitleBarSize = titleBarTablePane.getPreferredSize();
preferredWidth = preferredTitleBarSize.width;
preferredHeight = preferredTitleBarSize.height;
if (content != null) {
Dimensions preferredContentSize = content.getPreferredSize();
preferredWidth = Math.max(preferredWidth, preferredContentSize.width);
preferredHeight += preferredContentSize.height;
}
preferredWidth += padding.getWidth() + 2;
preferredHeight += padding.getHeight() + 4;
return new Dimensions(preferredWidth, preferredHeight);
}
use of org.apache.pivot.wtk.Component in project pivot by apache.
the class TerraPaletteSkin method getPreferredWidth.
@Override
public int getPreferredWidth(int height) {
int preferredWidth = 0;
Palette palette = (Palette) getComponent();
Component content = palette.getContent();
Dimensions preferredTitleBarSize = titleBarTablePane.getPreferredSize();
preferredWidth = preferredTitleBarSize.width;
if (content != null) {
if (height != -1) {
height = Math.max(height - preferredTitleBarSize.height - 4 - padding.getHeight(), 0);
}
preferredWidth = Math.max(preferredWidth, content.getPreferredWidth(height));
}
preferredWidth += padding.getWidth() + 2;
return preferredWidth;
}
use of org.apache.pivot.wtk.Component in project pivot by apache.
the class TerraPanoramaSkin method getPreferredHeight.
@Override
public int getPreferredHeight(int width) {
int preferredHeight = 0;
// The panorama's preferred height is the preferred height of the view
Panorama panorama = (Panorama) getComponent();
Component view = panorama.getView();
if (view != null) {
preferredHeight = view.getPreferredHeight(width);
}
return preferredHeight;
}
use of org.apache.pivot.wtk.Component in project pivot by apache.
the class TerraPanoramaSkin method getMaxScrollLeft.
protected int getMaxScrollLeft() {
int maxScrollLeft = 0;
Panorama panorama = (Panorama) getComponent();
int width = getWidth();
Component view = panorama.getView();
if (view != null) {
maxScrollLeft = Math.max(view.getWidth() - width, 0);
}
return maxScrollLeft;
}
use of org.apache.pivot.wtk.Component in project pivot by apache.
the class TerraPanoramaSkin method getPreferredSize.
@Override
public Dimensions getPreferredSize() {
Dimensions preferredSize = null;
// The panorama's preferred size is the preferred size of the view
Panorama panorama = (Panorama) getComponent();
Component view = panorama.getView();
if (view == null) {
preferredSize = Dimensions.ZERO;
} else {
preferredSize = view.getPreferredSize();
}
return preferredSize;
}
Aggregations