Package TimeTable.spans

Examples of TimeTable.spans.TimeSpan


        long endTime = beginTime + 24*3600*1000;
       
        // Y coord
        for (int i = 0; i < spans.size(); i++) {
            TimeSpanInternal s = spans.get(i);
            TimeSpan ts = s.span;
            long spanBegin = ts.getBegin().getTime();
            long spanEnd = spanBegin + ts.getLength()*60*1000;
           
            //pass hidden
            if (spanBegin >= endTime || spanEnd <= beginTime) {
                s.visible = false;
                continue;
View Full Code Here


                spans.get(i).span.removeTimeSpanListener(this);
            }
            spans.clear();

            for (int i = 0; i < model.getSpanCount(); i++) {
                TimeSpan span = model.getSpan(i);
                TimeSpanInternal internal = new TimeSpanInternal();
                internal.span = span;
                internal.rc = new Rectangle();
                internal.relocateY = true;
                spans.add(internal);
                span.addTimeSpanListener(this);
                System.out.println("rebuild content: item added at " + span.getBegin()
                        + ", length " + span.getLength() + " LOADED");
            }
            rebuildInternal = false;
            System.out.println("rebuild content finished: " + model.getSpanCount() + " LOADED");
        }
View Full Code Here

            }
            Point pt = event.getPoint();
            //System.out.println("Mouse pressed: " + pt.x + "," + pt.y);
            for (int i = spans.size() - 1; i >= 0; i--) {
                TimeSpanInternal si = spans.get(i);
                TimeSpan span = si.span;

                int resize = span.checkPointResize(pt, si.rc);
                if (resize != TimeSpan.NORESIZE) {
                    if (resize == TimeSpan.RESIZE_TOP) {
                        spanResizedTop = span;
                        spanResizedBottom = null;
                    } else if (resize == TimeSpan.RESIZE_BOTTOM) {
                        spanResizedTop = null;
                        spanResizedBottom = span;
                    }
                    break;
                } else if (span.checkOverDragArea(pt, si.rc)) {
                    //System.out.println("Drag on: " + pt.x + "," + pt.y);
                    spanDragged = span;
                    dragOffsetY = si.rc.y - pt.y;
                    break;
                }
View Full Code Here

            if (spanDragged != null) {
                return;
            }

            Point pt = event.getPoint();
            TimeSpan last = mouseOverSpan;
            mouseOverSpan = null;
            //find active timespan
            for (int i = spans.size() - 1; i >= 0; i--) {
                TimeSpanInternal si = spans.get(i);
                if (!si.visible) {
                    continue;
                }

                TimeSpan span = si.span;
                int resize = span.checkPointResize(pt, si.rc);
                if (resize != TimeSpan.NORESIZE) {
                    if (resize == TimeSpan.RESIZE_TOP) {
                        mouseOverSpan = span;
                        setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR));
                    } else if (resize == TimeSpan.RESIZE_BOTTOM) {
                        mouseOverSpan = span;
                        setCursor(Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR));
                    }
                    break;

                } else if (span.checkOverDragArea(pt, si.rc)) {
                    mouseOverSpan = span;
                    setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                    break;

                } else {
View Full Code Here

        public void mouseDragged(MouseEvent arg0) {}

        public void mouseMoved(MouseEvent event) {
            Point pt = event.getPoint();
            TimeSpan last = mouseOverSpan;
            mouseOverSpan = null;
            //find active timespan
            for (int i = spans.size() - 1; i >= 0; i--) {
                TimeSpanInternal si = spans.get(i);
                if (!si.visible) {
                    continue;
                }

                TimeSpan span = si.span;
                if (span.checkOverDragArea(pt, si.rc)) {
                    mouseOverSpan = span;
                    setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                    break;

                } else {
View Full Code Here

TOP

Related Classes of TimeTable.spans.TimeSpan

Copyright © 2018 www.massapicom. 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.