Examples of TimingTargetAdapter


Examples of org.jdesktop.core.animation.timing.TimingTargetAdapter

      }
     
      final RGB from = getRenderBackground();
      final RGB to = new RGB(red, green, blue);
     
      TimingTarget timingTarget = new TimingTargetAdapter() {
        @Override
        public void timingEvent(Animator source, double fraction) {
          int red = (int )Math.round(from.red + (to.red - from.red) * fraction);
          int green = (int )Math.round(from.green + (to.green - from.green) * fraction);
          int blue = (int )Math.round(from.blue + (to.blue - from.blue) * fraction);
 
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingTargetAdapter

     
      if (from.equals(to)) {
        return;
      }
     
      TimingTarget timingTarget = new TimingTargetAdapter() {

        @Override
        public void timingEvent(Animator source, double fraction) {
          double doubleLeft = from.getLeft() + (to.getLeft() - from.getLeft()) * fraction;
          double doubleRight = from.getRight() + (to.getRight() - from.getRight()) * fraction;
 
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingTargetAdapter

      if (from.red == red && from.green == green && from.blue == blue) {
        return;
      }
     
      TimingTarget timingTarget = new TimingTargetAdapter() {
       
        @Override
        public void timingEvent(Animator source, double fraction) {
          double doubleRed = from.red + (red - from.red) * fraction;
          double doubleGreen = from.green + (green - from.green) * fraction;
 
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingTargetAdapter

      }
     
      final Bounds from = Bounds.fromRectangle(getBounds());
      final Bounds to = Bounds.fromXYWidthHeight(x, y, width, height);
     
      TimingTarget timingTarget = new TimingTargetAdapter() {
        @Override
        public void timingEvent(Animator source, double fraction) {
          double leftDiff = (to.getLeft() - from.getLeft()) * fraction;
          double rightDiff = (to.getRight() - from.getRight()) * fraction;
          double topDiff = (to.getTop() - from.getTop()) * fraction;
 
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingTargetAdapter

        return;
      }
     
      final RGB from = new RGB(foreground.red, foreground.green, foreground.blue);
     
      TimingTarget timingTarget = new TimingTargetAdapter() {
        @Override
        public void timingEvent(Animator source, double fraction) {
          double redDiff = (red - from.red) * fraction;
          double greenDiff = (green - from.green) * fraction;
          double blueDiff = (blue - from.blue) * fraction;
 
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingTargetAdapter

        return;
      }
     
      final RGB from = new RGB(background.red, background.green, background.blue);
     
      TimingTarget timingTarget = new TimingTargetAdapter() {
        @Override
        public void timingEvent(Animator source, double fraction) {
          double redDiff = (red - from.red) * fraction;
          double greenDiff = (green - from.green) * fraction;
          double blueDiff = (blue - from.blue) * fraction;
 
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingTargetAdapter

    }

    public void start() {
      Rectangle bounds = target.getBounds();
     
      TimingTarget tt = new TimingTargetAdapter() {

        @Override
        public void timingEvent(Animator source, double fraction) {
          double doubleDistance = (to - from) * fraction;
          int intDistance = (int )Math.round(doubleDistance);
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingTargetAdapter

               
                int index = delta > 0 ? 0 : 1;
               
                for (StripItem item : affected) {
                  Rectangle toSet = boundsMap.get(item)[index];
                  item.setBounds(toSet, true, new TimingTargetAdapter() {
                    @Override
                    public void end(Animator source) {
                      processFocus();
                    }

                    @Override
                    public void timingEvent(Animator source, double fraction) {
                      processFocus();
                    }
                   
                    private void processFocus() {
                      Point location = getDisplay().getCursorLocation();
                      location = toControl(location);
                      onProcessFocus(location.x, location.y);
                    }
                  });
                }
              } else {
                StripItem onItem = getItem(event.x, event.y);
               
                if (onItem != null && !onItem.equals(mouseItem)) {
                  Rectangle mouseBounds = mouseItem.getBounds();
                  StripItem[] affected = getAffectedItemsNonAnimated(mouseItem, onItem);
                 
                  if (onItem.getBounds().x > mouseItem.getBounds().x) {
                    for (StripItem aff : affected) {
                      Rectangle bounds = boundsMap.get(aff)[0];
                      aff.setBounds(bounds, false, null);
                     
                      mouseBounds.x += bounds.width;
                      mouseBounds.x += SPACE;
                    }
                  } else {
                    for (StripItem aff : affected) {
                      Rectangle bounds = boundsMap.get(aff)[1];
                      aff.setBounds(bounds, false, null);
                     
                      mouseBounds.x -= bounds.width;
                      mouseBounds.x -= SPACE;
                    }
                  }
                 
                  mouseItem.setBounds(mouseBounds, false, null);
                 
                  Point location = new Point(mouseBounds.x + mouseBounds.width / 2, mouseBounds.y + mouseBounds.height / 2);
                  location = toDisplay(location);
                  getDisplay().setCursorLocation(location);
                }
              }
            }
          }
         
          mouseMove = new Point(event.x, event.y);
        }
      } else if (event.type == SWT.MouseUp) {
        if (event.button == 1) {
          if (mouseItem != null) {
            int itemState = mouseItem.getState();
            boolean wasSelected = (itemState & StripItem.SELECTED) == StripItem.SELECTED;
            itemState &= ~StripItem.PRESSED;
           
            if ((itemState & StripItem.DRAGGED) == StripItem.DRAGGED) {
              itemState &= ~StripItem.DRAGGED;
            } else {
              if (isMultiSelect()) {
                if (wasSelected) {
                  itemState &= ~StripItem.SELECTED;
                } else {
                  itemState |= StripItem.SELECTED;
                }
              } else {
                if (!wasSelected) {
                  itemState |= StripItem.SELECTED;
                 
                  for (StripItem otherItem : items) {
                    int otherState = otherItem.getState();
                    otherState &= ~StripItem.SELECTED;
                    otherItem.setState(otherState, animate);
                  }
                }
              }
            }
           
            mouseItem.setState(itemState, false);
           
            reorderItems();
           
            if (isAnimate()) {
              Rectangle compute = computeBounds(mouseItem);
              mouseItem.setBounds(compute, true, new TimingTargetAdapter() {
                @Override
                public void end(Animator source) {
                  processFocus();
                }
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingTargetAdapter

      if (backgroundAnimator != null) {
        backgroundAnimator.cancel();
        backgroundAnimator = null;
      }

      TimingTarget timingTarget = new TimingTargetAdapter() {
        private final RGB from = getBackground();
        private final RGB to = value.getBackground();
       
        @Override
        public void timingEvent(Animator source, double fraction) {
View Full Code Here

Examples of org.jdesktop.core.animation.timing.TimingTargetAdapter

      if (offsetAnimator != null) {
        offsetAnimator.cancel();
        offsetAnimator = null;
      }
     
      TimingTarget timingTarget = new TimingTargetAdapter() {
        private final int from = offset;
        private final int to = value;
       
        @Override
        public void timingEvent(Animator source, double fraction) {
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.