Examples of Scrollable


Examples of org.eclipse.swt.widgets.Scrollable

    if (!OwlUI.isHighContrast()) {
      fItemViewer.getControl().addListener(SWT.EraseItem, new Listener() {
        public void handleEvent(Event event) {
          ToolBarItem item = (ToolBarItem) event.item.getData();
          if (item.item == CoolBarItem.SEPARATOR) {
            Scrollable scrollable = (Scrollable) event.widget;
            GC gc = event.gc;

            Rectangle area = scrollable.getClientArea();
            Rectangle rect = event.getBounds();

            /* Paint the selection beyond the end of last column */
            OwlUI.codExpandRegion(event, scrollable, gc, area);

View Full Code Here

Examples of org.eclipse.swt.widgets.Scrollable

      eraseGroup(event, (EntityGroup) element);

  }

  private void eraseGroup(Event event, EntityGroup group) {
    Scrollable scrollable = (Scrollable) event.widget;
    GC gc = event.gc;

    /* Draw Color if Selected */
    if (group.getColorHint() != null && (event.detail & SWT.SELECTED) != 0) {

      /* Some conditions under which we don't override the selection color */
      if (!scrollable.isFocusControl() || isInvalidColor(group.getColorHint()))
        return;

      Rectangle clArea = scrollable.getClientArea();
      Rectangle itemRect = event.getBounds();

      /* Paint the selection beyond the end of last column */
      OwlUI.codExpandRegion(event, scrollable, gc, clArea);

      /* Draw Rectangle */
      Color oldBackground = gc.getBackground();
      gc.setBackground(OwlUI.getColor(fResources, group.getColorHint()));
      gc.fillRectangle(0, itemRect.y, clArea.width, itemRect.height);
      gc.setBackground(oldBackground);
      gc.setForeground(scrollable.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));

      /* Mark as Selected being handled */
      event.detail &= ~SWT.SELECTED;
    }

View Full Code Here

Examples of org.eclipse.swt.widgets.Scrollable

    else
      OwlUI.codDrawGradient(event, fGradientFgColor, fGradientBgColor, fGradientEndColor);
  }

  private void eraseNews(Event event, INews news) {
    Scrollable scrollable = (Scrollable) event.widget;
    GC gc = event.gc;

    /* Handle selected News (Linux: Note Bug 444) */
    if ((event.detail & SWT.SELECTED) != 0 && (Application.IS_WINDOWS || !news.isFlagged())) {

      /* Do not override selection color if not focus control */
      if (!scrollable.isFocusControl())
        return;

      /* Load Labels */
      Set<ILabel> labels = CoreUtils.getSortedLabels(news);
      if (labels.isEmpty())
        return;

      ILabel label = labels.iterator().next();
      if (isInvalidColor(label))
        return;

      Rectangle clArea = scrollable.getClientArea();
      Rectangle itemRect = event.getBounds();

      /* Paint the selection beyond the end of last column */
      OwlUI.codExpandRegion(event, scrollable, gc, clArea);

      /* Draw Rectangle */
      Color oldBackground = gc.getBackground();
      gc.setBackground(OwlUI.getColor(fResources, label));
      gc.fillRectangle(0, itemRect.y, clArea.width, itemRect.height);
      gc.setBackground(oldBackground);
      gc.setForeground(scrollable.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));

      /* Mark as Selected being handled */
      event.detail &= ~SWT.SELECTED;
    }

    /* Handle Non-Selected flagged News */
    else if (news.isFlagged()) {
      Rectangle clArea = scrollable.getClientArea();
      Rectangle itemRect = event.getBounds();

      /* Paint the selection beyond the end of last column */
      OwlUI.codExpandRegion(event, scrollable, gc, clArea);

View Full Code Here

Examples of org.eclipse.swt.widgets.Scrollable

   * @param fg gradient foreground.
   * @param bg gradient background.
   * @param end gradient end.
   */
  public static void codDrawGradient(Event event, Color fg, Color bg, Color end) {
    Scrollable scrollable = (Scrollable) event.widget;
    GC gc = event.gc;

    Rectangle area = scrollable.getClientArea();
    Rectangle rect = event.getBounds();

    /* Paint the selection beyond the end of last column */
    codExpandRegion(event, scrollable, gc, area);

View Full Code Here

Examples of org.eclipse.swt.widgets.Scrollable

      return null;
    }

    void eraseGroup(Event event) {
      Scrollable scrollable = (Scrollable) event.widget;
      GC gc = event.gc;

      Rectangle area = scrollable.getClientArea();
      Rectangle rect = event.getBounds();

      /* Paint the selection beyond the end of last column */
      OwlUI.codExpandRegion(event, scrollable, gc, area);

View Full Code Here

Examples of org.eclipse.swt.widgets.Scrollable

                return GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).hint(Geometry.max(button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true), LayoutConstants.getMinButtonSize()));
            }
        }

        if (control instanceof Scrollable) {
            Scrollable scrollable = (Scrollable) control;

            if (scrollable instanceof Composite) {
                Composite composite = (Composite) control;

                Layout theLayout = composite.getLayout();
View Full Code Here

Examples of org.eclipse.swt.widgets.Scrollable

   * @see org.eclipse.swt.widgets.Layout#layout(org.eclipse.swt.widgets.Composite,
   *      boolean)
   */
  protected void layout(Composite composite, boolean flushCache) {
    Rectangle area = composite.getClientArea();
    Scrollable table = getControl(composite);
    int tableWidth = table.getSize().x;
    int trim = computeTrim(area, table, tableWidth);
    int width = Math.max(0, area.width - trim);

    if (width > 1)
      layoutTableTree(table, width, area, tableWidth < area.width);
View Full Code Here

Examples of org.getspout.spoutapi.gui.Scrollable

              control.setDirty(false);
            }
          } else if (control instanceof Scrollable) {
            if (data.equals("HORIZONTAL") || data.equals("VERTICAL")) {
              Orientation axis = Orientation.valueOf(data);
              Scrollable scroll = (Scrollable) control;
              scroll.setScrollPosition(axis, (int) state);
            } else if (control instanceof ListWidget) {
              ListWidget list = (ListWidget) control;
              boolean dblclick = false;
              if (data.equals("click") || data.equals("doubleclick") || data.equals("selected")) {
                int item = (int) state;
View Full Code Here

Examples of org.rascalmpl.library.vis.figure.interaction.swtwidgets.Scrollable

      throw new Error("Rotate out of order..");
      //return new Rotate(env, angle, child, properties);
     

    case SCROLLABLE:
      return new Scrollable(((IBool)c.get(0)).getValue(), ((IBool)c.get(1)).getValue(), env, (IConstructor)c.get(2),  properties);
     
    case SPACE:
      return new Space( makeChild(env,c,properties,childPropsNext), properties );
     
    case TEXT:
View Full Code Here

Examples of org.spoutcraft.api.gui.Scrollable

    }
    for (Widget w : getScreen().getAttachedWidgets(true)) {
      if (w != null && isInBoundingRect(w, x, y)) {
        if (w instanceof Scrollable) {
          // Stupid LWJGL not recognizing vertical scrolls :(
          Scrollable lw = (Scrollable) w;
          if (axis == Orientation.VERTICAL) {
            lw.scroll(0, -scroll / 30);
          } else {
            lw.scroll(-scroll / 30, 0);
          }
          PacketControlAction action = new PacketControlAction(lw.getScreen() != null ? lw.getScreen() : getScreen(), lw, axis.toString(), lw.getScrollPosition(axis));
          SpoutClient.getInstance().getPacketManager().sendSpoutPacket(action);
        }
      }
    }
  }
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.