use of limelight.util.Box in project limelight by slagyr.
the class ScrollMouseProcessor method processBlockIncremementDrag.
private void processBlockIncremementDrag() {
if (scrollBar.getTrackBounds().contains(mouseLocation)) {
Box sliderBounds = scrollBar.getSliderBounds();
final boolean shouldReverseBlockIncrement = (repeater.getScrollDelta() < 0 && isAfterSlider(mouseLocation, sliderBounds)) || (repeater.getScrollDelta() > 0 && isBeforeSlider(mouseLocation, sliderBounds));
if (shouldReverseBlockIncrement)
repeater.setScrollDelta(repeater.getScrollDelta() * -1);
startRepeater();
} else
repeater.stop();
}
use of limelight.util.Box in project limelight by slagyr.
the class TextPanelBorderPainter method paint.
public void paint(Graphics2D graphics, PaintablePanel panel) {
if (shouldPaintSpecialBorder(panel)) {
try {
Box bounds = panel.getMarginedBounds();
normalBorder.draw(graphics, bounds.x, bounds.y, bounds.width, bounds.height);
if (panel.hasFocus())
focusedBorder.draw(graphics, bounds.x, bounds.y, bounds.width, bounds.height);
} catch (Exception e) {
System.err.println("TextPanel: NinePatch choked again");
}
} else
BorderPainter.instance.paint(graphics, panel);
}
use of limelight.util.Box in project limelight by slagyr.
the class FloaterLayout method doFinalization.
//TODO Floater need to change position when scrolled too.
@Override
public void doFinalization(Panel thePanel) {
PanelBase panel = (PanelBase) thePanel;
if (panel.isFloater()) {
Box area = panel.getParent().getChildConsumableBounds();
int newX = panel.getStyle().getCompiledX().getX(0, area);
int newY = panel.getStyle().getCompiledY().getY(0, area);
panel.markAsDirty();
panel.setLocation(newX, newY);
panel.markAsDirty();
}
}
use of limelight.util.Box in project limelight by slagyr.
the class ImagePanelLayout method doExpansion.
@Override
public void doExpansion(Panel thePanel) {
ImagePanel panel = (ImagePanel) thePanel;
Box consumableArea = panel.getParent().getChildConsumableBounds();
if (panel.getImage() == null)
return;
Dimension size;
if (panel.isScaled())
size = new Dimension(consumableArea.width, consumableArea.height);
else
size = new Dimension((int) (panel.getImageWidth() + 0.5), (int) (panel.getImageHeight() + 0.5));
if (panel.getImage() != null) {
handleRotation(panel);
handleAutoDimensions(panel, size);
}
panel.setSize(size.width, size.height);
}
use of limelight.util.Box in project limelight by slagyr.
the class PaintJob method paint.
public void paint(Panel panel) {
Box panelBounds = panel.getAbsoluteBounds();
int x = panelBounds.x - clip.x;
int y = panelBounds.y - clip.y;
Graphics2D graphics = (Graphics2D) rootGraphics.create(x, y, panel.getWidth(), panel.getHeight());
paint(panel, graphics);
graphics.dispose();
rootGraphics.dispose();
}
Aggregations