383384385386387388389390391392393394395
return items.length; } @Override public Padding getPadding() { final Padding in = super.getPadding(); in.extendTop(VPADDING); in.extendBottom(VPADDING); in.extendLeft(HPADDING + 5); in.extendRight(HPADDING + 5); return in; }
416417418419420421422423424425426427
} else { final Workspace workspace = getWorkspace(); final Location location = new Location(getAbsoluteLocation()); location.subtract(workspace.getView().getAbsoluteLocation()); final Padding padding = workspace.getView().getPadding(); location.move(-padding.getLeft(), -padding.getTop()); final int itemHeight = style().getLineHeight() + VPADDING; final int baseLine = itemHeight * option; location.add(0, baseLine);
5960616263646566
s.ensureHeight(26); assertEquals(new Size(18, 26), s); } public void addPadding() { s.extend(new Padding(1, 2, 3, 4)); assertEquals(new Size(14, 26), s); }
292293294295296297298
return size; } @Override public Padding getPadding() { return new Padding(BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH); }
262263264265266267268269270271272273
} @Override public View subviewFor(final Location location) { final Location l = new Location(location); final Padding padding = getPadding(); l.subtract(padding.getLeft(), padding.getTop()); final View views[] = getSubviews(); for (int i = views.length - 1; i >= 0; i--) { if (views[i].getBounds().contains(l)) { return views[i]; }
250251252253254255256
} } @Override public Padding getPadding() { return new Padding(); }
8182838485868788899091
b.contractHeight(12); assertEquals(8, b.getHeight()); } public void testContractPadding() { b.contract(new Padding(2, 4, 1, 3)); assertEquals(3, b.getWidth()); assertEquals(17, b.getHeight()); assertEquals(9, b.getX()); assertEquals(12, b.getY()); }
5051525354555657585960
this.view = view; this.location = new Location(location); offset = view.getAbsoluteLocation(); final Padding targetPadding = view.getPadding(); final Padding containerPadding = view.getView().getPadding(); offset.add(containerPadding.getLeft() - targetPadding.getLeft(), containerPadding.getTop() - targetPadding.getTop()); this.location.subtract(offset); }
6465666768697071727374
location = new Location(); offset = new Location(off.getDeltaX(), off.getDeltaY()); final Padding targetPadding = view.getPadding(); final Padding containerPadding = view.getView().getPadding(); offset.add(containerPadding.getLeft() - targetPadding.getLeft(), containerPadding.getTop() - targetPadding.getTop()); this.location.subtract(offset); }
495051525354555657585960