Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2011 Cologne University of Applied Sciences Licensed under the
  * Educational Community License, Version 2.0 (the "License"); you may
  * not use this file except in compliance with the License. You may
  * obtain a copy of the License at
  *
  * http://www.osedu.org/licenses/ECL-2.0
  *
  * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an "AS IS"
 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
package org.amcgala.framework.shape.util;
CompositeShape for Shapeobjects.

Author(s):
Sascha Lemke
public class CompositeShape extends AbstractShape implements InputHandler {
    private static final Logger log = LoggerFactory.getLogger(CompositeShape.class.getName());
    private List<Shapeshapes;


    
Creates an empty Containerobject.
    public CompositeShape() {
         = new ArrayList<Shape>();
    }

    
Creates an Containobject with the given shapes.

Parameters:
shapes
    public CompositeShape(Shape... shapes) {
        this();
        Collections.addAll(this.shapes);
    }

    
Fügt Shapes dem CompositeShape hinzu.

Parameters:
shapes die shapes, die dem CompositeShape hinzugefügt werden sollen
    public void add(Shape... shapes) {
        Collections.addAll(this.shapes);
    }

    
Removes the last entry.

Returns:
    public void removeLast() {
        .remove(this..size() - 1);
    }

    
Entfernt ein AbstractShape aus dem CompositeShape entfernen.

Parameters:
shape das AbstractShape, das entfernt werden soll
    public void remove(Shape shape) {
        this..remove(shape);
    }
    @Override
    public String toString() {
        return Objects.toStringHelper(getClass()).add("Shapes").toString();
    }

    
    @Override
    public void render(Renderer renderer) {
        for (Shape shape : ) {
            shape.setColor(getColor());
            shape.render(renderer);
        }
    }
New to GrepCode? Check out our FAQ X