Examples of Offset


Examples of net.sourceforge.ganttproject.chart.ChartModelBase.Offset

                length += offsets[offsets.length-1].getOffsetPixels();
                continue;
            }
            //int firstOffsetPixels = offsets[0].getOffsetPixels();
            for (int i=0; i<offsets.length; i++) {
                Offset offset = offsets[i];
                if (false==offset.getOffsetEnd().before(offsetDate)) {
                    length+=(offset.getOffsetPixels());
                    break;
                }
            }
            break;
        }
View Full Code Here

Examples of net.sourceforge.ganttproject.chart.ChartModelBase.Offset

        Offset[] offsets = offsetCalculator.calculateOffsets(weekTimeFrame, myStack.WEEK_AS_BOTTOM_UNIT, monday.getTime(), myStack.getDefaultTimeUnit(), 70);
        assertEquals("Unexpected offsets count", 7, offsets.length);
        TaskActivity fridayActivity = task.getActivities()[0];
        int pixelOffset = 0;
        for (int i=0; i<offsets.length; i++) {
            Offset next = offsets[i];
            pixelOffset = next.getOffsetPixels();
            if (fridayActivity.getStart().equals(next.getOffsetEnd())) {
                break;
            }
        }
        assertEquals("Unexpected offset in pixels, for task starting on friday", 40, pixelOffset);
    }
View Full Code Here

Examples of org.apache.isis.viewer.dnd.drawing.Offset

        ;
        if (x < left - BORDER) {
            return Toolkit.getViewFactory().createDragContentOutline(this, drag.getLocation());
        } else if (x < left) {
            final View dragOverlay = new DragViewOutline(getView());
            return new ViewDragImpl(this, new Offset(drag.getLocation()), dragOverlay);
        } else {
            return super.dragStart(drag);
        }
    }
View Full Code Here

Examples of org.apache.isis.viewer.dnd.drawing.Offset

    @Override
    public DragEvent dragStart(final DragStart drag) {
        if (overBorder(drag.getLocation())) {
            final Location location = drag.getLocation();
            final DragViewOutline dragOverlay = new DragViewOutline(getView());
            return new ViewDragImpl(this, new Offset(location.getX(), location.getY()), dragOverlay);
        } else {
            return super.dragStart(drag);
        }
    }
View Full Code Here

Examples of org.apache.isis.viewer.dnd.drawing.Offset

            drag.subtract(subview.getLocation());
            return subview.dragStart(drag);
        } else {
            if (drag.isCtrl()) {
                final View dragOverlay = new DragViewOutline(getView());
                return new ViewDragImpl(this, new Offset(drag.getLocation()), dragOverlay);
            } else {
                return Toolkit.getViewFactory().createDragContentOutline(this, drag.getLocation());
            }
        }
    }
View Full Code Here

Examples of org.apache.isis.viewer.dnd.drawing.Offset

        if (drag.getLocation().getX() > getSize().getWidth() - right) {
            if (getContent().getAdapter() == null) {
                return null;
            }
            final View dragOverlay = new DragViewOutline(getView());
            return new ViewDragImpl(this, new Offset(drag.getLocation()), dragOverlay);
        } else {
            return super.dragStart(drag);
        }
    }
View Full Code Here

Examples of org.apache.isis.viewer.dnd.drawing.Offset

        return adjust(drag.getTargetLocation());
    }

    private int adjust(final Location location) {
        final Bounds contentArea = viewportArea();
        final Offset offset = offset();
        final int yOffset = offset.getDeltaY();
        final int xOffset = offset.getDeltaX();
        if (contentArea.contains(location)) {
            location.subtract(left, top);
            location.add(xOffset, yOffset);
            return CENTER;
        } else {
View Full Code Here

Examples of org.apache.isis.viewer.dnd.drawing.Offset

        final int y = location.getY();
        if (verticalScrollBar.isOnThumb(y)) {
            // offset is the distance from the left/top of the thumb to the
            // pointer
            offsetToThumbEdge = y - verticalScrollBar.getPosition();
            return new SimpleInternalDrag(this, new Offset(super.getAbsoluteLocation()));
        } else {
            return null;
        }
    }
View Full Code Here

Examples of org.apache.isis.viewer.dnd.drawing.Offset

    private DragEvent dragStartSouth(final DragStart drag) {
        final Location location = drag.getLocation();
        final int x = location.getX();
        if (horizontalScrollBar.isOnThumb(x)) {
            offsetToThumbEdge = x - horizontalScrollBar.getPosition();
            return new SimpleInternalDrag(this, new Offset(super.getAbsoluteLocation()));
        } else {
            return null;
        }
    }
View Full Code Here

Examples of org.apache.isis.viewer.dnd.drawing.Offset

    }

    @Override
    public void draw(final Canvas canvas) {
        final Bounds contents = viewportArea();
        final Offset offset = offset();
        final int x = offset.getDeltaX();
        final int y = offset.getDeltaY();

        final int contentWidth = contents.getWidth();
        final int contentHeight = contents.getHeight();

        final Canvas headerCanvasLeft = canvas.createSubcanvas(0, top, left, contentHeight);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.