Examples of Decorator


Examples of org.apache.pivot.wtk.effects.Decorator

                // Prepare the decorators
                DecoratorSequence decorators = component.getDecorators();
                int n = decorators.getLength();
                for (int j = n - 1; j >= 0; j--) {
                    Decorator decorator = decorators.get(j);
                    decoratedGraphics = decorator.prepare(component, decoratedGraphics);
                }

                // Paint the component
                Graphics2D componentGraphics = (Graphics2D)decoratedGraphics.create();
                componentGraphics.clipRect(0, 0, componentBounds.width, componentBounds.height);
                component.paint(componentGraphics);
                componentGraphics.dispose();

                // Update the decorators
                for (int j = 0; j < n; j++) {
                    Decorator decorator = decorators.get(j);
                    decorator.update();
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.pivot.wtk.effects.Decorator

            // Repaint the the component's previous decorated region
            if (parent != null) {
                parent.repaint(getDecoratedBounds());
            }

            Decorator previousDecorator = decorators.update(index, decorator);

            // Repaint the the component's current decorated region
            if (parent != null) {
                parent.repaint(getDecoratedBounds());
            }
View Full Code Here

Examples of org.freezedry.persistence.keyvalue.renderers.decorators.Decorator

   * @return the {@link Decorator} that was used to decorate the specified value, or
   * if no such {@link Decorator} was found, returns null.
   */
  public Decorator getDecorator( final String value )
  {
    Decorator foundDecorator = null;
    for( Decorator decorator : decorators.values() )
    {
      if( decorator.isDecorated( value ) )
      {
        foundDecorator = decorator;
View Full Code Here

Examples of org.freezedry.persistence.keyvalue.renderers.decorators.Decorator

   * @return the {@link Decorator} that was used to decorate the specified value, or
   * if no such {@link Decorator} was found, returns null.
   */
  public Decorator getDecorator( final String value )
  {
    Decorator foundDecorator = null;
    for( Decorator decorator : decorators.values() )
    {
      if( decorator.isDecorated( value ) )
      {
        foundDecorator = decorator;
View Full Code Here

Examples of org.jamesii.gui.decoration.Decorator

    progressPanel.add(progressLabel, c);
    c = new GridBagConstraints();
    c.gridy = 1;
    progressPanel.add(progressBar, c);

    Decorator deco = new Decorator(progressPanel, new MirrorDecoration(50, 0));
    getContentPane().add(deco, BorderLayout.PAGE_START);

    if (cancelable) {
      JButton cancelButton =
          new JButton(new TaskCancelAction("Cancel", null, task, 10000));
View Full Code Here

Examples of org.jboss.resteasy.annotations.Decorator

      // override any class level ones
      if (annotations != null)
      {
         for (Annotation annotation : annotations)
         {
            Decorator decorator = annotation.annotationType().getAnnotation(Decorator.class);
            if (decorator != null && targetClass.isAssignableFrom(decorator.target()))
            {
               meta.put(annotation.annotationType(), annotation);
            }
         }
      }
      if (meta.size() == 0) return target;

      MediaTypeMap<Class<?>> typeMap = new MediaTypeMap<Class<?>>();
      for (Class<?> decoratorAnnotation : meta.keySet())
      {
         Decorator decorator = decoratorAnnotation.getAnnotation(Decorator.class);
         String[] mediaTypes = {"*/*"};
         DecorateTypes produces = decorator.processor().getAnnotation(DecorateTypes.class);
         if (produces != null)
         {
            mediaTypes = produces.value();
         }
         for (String pType : mediaTypes)
         {
            typeMap.add(MediaType.valueOf(pType), decoratorAnnotation);
         }
      }

      List<Class<?>> list = typeMap.getPossible(mediaType);
      for (Class<?> decoratorAnnotation : list)
      {
         Annotation annotation = meta.get(decoratorAnnotation);
         Decorator decorator = decoratorAnnotation.getAnnotation(Decorator.class);
         DecoratorProcessor processor = null;
         try
         {
            processor = decorator.processor().newInstance();
         }
         catch (InstantiationException e)
         {
            throw new RuntimeException(e.getCause());
         }
View Full Code Here

Examples of org.locationtech.geogig.di.Decorator

        // bind separate caches for the object and staging databases

        bind(ObjectDatabaseCacheFactory.class).in(Scopes.SINGLETON);
        bind(StagingDatabaseCacheFactory.class).in(Scopes.SINGLETON);

        Decorator objectCachingDecorator = ObjectDatabaseCacheInterceptor
                .objects(getProvider(ObjectDatabaseCacheFactory.class));

        Decorator indexCachingDecorator = ObjectDatabaseCacheInterceptor
                .staging(getProvider(StagingDatabaseCacheFactory.class));

        GeogigModule.bindDecorator(binder(), objectCachingDecorator);
        GeogigModule.bindDecorator(binder(), indexCachingDecorator);
    }
View Full Code Here

Examples of org.sonar.api.batch.Decorator

  }

  @Test
  public void decoratorsShouldBeExecutedBeforeFormulas() {
    Project project = new Project("key");
    Decorator metric1Decorator = new Metric1Decorator();
    BatchExtensionDictionnary batchExtDictionnary = newBatchDictionnary(withFormula1, metric1Decorator);

    Collection<Decorator> decorators = new DecoratorsSelector(batchExtDictionnary).select(project);

    Decorator firstDecorator = Iterables.get(decorators, 0);
    Decorator secondDecorator = Iterables.get(decorators, 1);

    assertThat(firstDecorator).isInstanceOf(Metric1Decorator.class);
    assertThat(secondDecorator).isInstanceOf(FormulaDecorator.class);

    FormulaDecorator formulaDecorator = (FormulaDecorator) secondDecorator;
View Full Code Here

Examples of pivot.wtk.effects.Decorator

                // Prepare the decorators
                DecoratorSequence decorators = component.getDecorators();
                int n = decorators.getLength();
                for (int i = n - 1; i >= 0; i--) {
                    Decorator decorator = decorators.get(i);
                    decoratedGraphics = decorator.prepare(component, decoratedGraphics);
                }

                // Paint the component
                Graphics2D componentGraphics = (Graphics2D)decoratedGraphics.create();
                componentGraphics.clipRect(0, 0, componentBounds.width, componentBounds.height);
                component.paint(componentGraphics);
                componentGraphics.dispose();

                // Update the decorators
                for (int i = 0; i < n; i++) {
                    Decorator decorator = decorators.get(i);
                    decorator.update();
                }
            }
        }
    }
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.