Package javafx.scene.paint

Examples of javafx.scene.paint.Color


            final TabSection nextSection = this.tabs.get(now.intValue());
            Label prevLabel = prevSection.label;
            Label nextLabel = nextSection.label;
            // It'd be nice to find a way of eliminating this duplication with the CSS file, but during initialisation
            // it seems styles were not applied yet. And JFX doesn't support CSS animations yet.
            Color inactiveColor = Color.web("#ff8888");
            Color activeColor = Color.RED;

            // Don't animate the tab transition the first time we appear.
            if (before.intValue() != -1) {
                final Animation colorAnim = new Transition() {
                    {
                        setCycleDuration(millis(400));
                    }

                    @Override
                    protected void interpolate(double v) {
                        Color color = inactiveColor.interpolate(activeColor, v);
                        nextLabel.setBackground(new Background(new BackgroundFill(color, null, null)));
                    }
                };
                colorAnim.play();
View Full Code Here


  }

  void applyItemProviderColor(Object item, Cell<?> cell, AdapterFactory adapterFactory) {
    IItemColorProvider colorProvider = (IItemColorProvider) adapterFactory.adapt(item, IItemColorProvider.class);
    if (colorProvider != null) {
      Color foreground = colorFromObject(colorProvider.getForeground(item));
      if (foreground != null)
        cell.setTextFill(foreground);

      String background = cssColorFromObject(colorProvider.getBackground(item));
      if (background != null)
View Full Code Here

  }

  void applyTableItemProviderColor(Object item, int columnIndex, Cell<?> cell, AdapterFactory adapterFactory) {
    ITableItemColorProvider colorProvider = (ITableItemColorProvider) adapterFactory.adapt(item, ITableItemColorProvider.class);
    if (colorProvider != null) {
      Color foreground = colorFromObject(colorProvider.getForeground(item, columnIndex));
      if (foreground != null)
        cell.setTextFill(foreground);

      String background = cssColorFromObject(colorProvider.getBackground(item, columnIndex));
      if (background != null)
View Full Code Here

    bind(sourceColor, hueShift, saturationFactor, brightnessFactor, opacityFactor);
  }
 
  @Override
  protected Color computeValue() {
    Color c = sourceColor.getValue().deriveColor(
        hueShift.getValue().doubleValue(),
        saturationFactor.getValue().doubleValue(),
        brightnessFactor.getValue().doubleValue(), opacityFactor.getValue().doubleValue());
    return c;
  }
View Full Code Here

  }

  @Test(expected = IllegalArgumentException.class)
  public void colorFromObjectWithIllegalNumberFormat() {
    URI uri = URI.createURI("color://rgb/100/XXX/0");
    Color color = cellFactory.colorFromObject(uri);
    assertEquals(Color.rgb(100, 200, 0), color);
  }
View Full Code Here

  }

  @Test
  public void colorFromObjectValidURI() {
    URI uri = URI.createURI("color://rgb/100/200/0");
    Color color = cellFactory.colorFromObject(uri);
    assertEquals(Color.rgb(100, 200, 0), color);
  }
View Full Code Here

TOP

Related Classes of javafx.scene.paint.Color

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.