Package org.adamtacy.client.ui

Examples of org.adamtacy.client.ui.Canvas


  public void reflectImage(NEffectPanel thePanel, int height, double opacity,
      int gap, boolean setUp) {

    DockPanel container;
    Widget w;
    Canvas v;
    SimplePanel gapPanel;

    if (setUp) {
      w = (Image) ((DockPanel) thePanel.getPanelWidget()).getWidget(0);
      v = (Canvas) ((DockPanel) thePanel.getPanelWidget()).getWidget(WHERE_IS_REFLECTION);
      v.setSize(1, 1);
      // v = new Canvas();
      container = (DockPanel) thePanel.getPanelWidget();
      // Remove from panel now as this may make any animations look much
      // smoother
      // If not, there is a danger on slow(er) systems that the reflection hangs
      // out from image until re-drawn.
      container.remove(WHERE_IS_REFLECTION);
    } else {
      container = new DockPanel();
      w = getReflectedImage(thePanel, setUp);
      v = new Canvas();
    }

    gapPanel = new SimplePanel();
    gapPanel.setWidth("100%");
    gapPanel.add(new HTML(" "));
    gapPanel.setHeight(gap + "px");

    int imgHeight = w.getOffsetHeight();
    int canvasHeight = (int) ((imgHeight * height) / 100);

    reflect(v.getElement(), w.getElement(), canvasHeight, opacity);

    if (setUp) {
      container.add(v, DockPanel.SOUTH);
    } else {
      container.add(w, DockPanel.NORTH);
View Full Code Here


      int gap, boolean setUp) {

    DockPanel container;
    Widget w;
    SimplePanel gapPanel;
    Canvas v;

    w = getReflectedImage(thePanel, setUp);
    if (setUp) {
      v = new Canvas();
      container = (DockPanel) thePanel.getPanelWidget();
      // Remove from panel now as this may make any animations look much
      // smoother
      // If not, there is a danger on slow(er) systems that the reflection hangs
      // out from image until re-drawn.
      container.remove(WHERE_IS_REFLECTION);
    } else {
      container = new DockPanel();
      v = new Canvas();
    }

    gapPanel = new SimplePanel();
    gapPanel.setWidth("100%");
    gapPanel.add(new HTML(" "));
    gapPanel.setHeight(gap + "px");

    int imgWidth = w.getOffsetWidth();
    int imgHeight = w.getOffsetHeight();
    int canvasHeight = (int) ((imgHeight * height) / 100);
    v.setSize(imgWidth, canvasHeight);

    reflect(v.getElement(), w.getElement(), canvasHeight, opacity);
    if (setUp) {
      container.add(v, DockPanel.SOUTH);
    } else {
      container.add(w, DockPanel.NORTH);
      container.add(v, DockPanel.SOUTH);
View Full Code Here

TOP

Related Classes of org.adamtacy.client.ui.Canvas

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.