jcckit.graphic.BasicGraphicalElement Maven / Gradle / Ivy
/*
* Copyright 2003-2004, Franz-Josef Elmer, All rights reserved
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details
* (http://www.gnu.org/copyleft/lesser.html).
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package jcckit.graphic;
/**
* Abstract superclass of all basic {@link GraphicalElement
* GraphicalElements}. Concrete subclasses have to implement
* the method {@link GraphicalElement#renderWith}.
*
* @author Franz-Josef Elmer
*/
public abstract class BasicGraphicalElement implements GraphicalElement {
private final GraphicAttributes _attributes;
/**
* Creates an instance with the specified drawing attributes.
* Note, that a {@link Renderer} should use default attributes
* in the case no attributes are defined.
* @param attributes Drawing attributes or null if undefined.
*/
public BasicGraphicalElement(GraphicAttributes attributes) {
_attributes = attributes;
}
/**
* Returns the drawing attributes.
* @return null if undefined.
*/
public GraphicAttributes getGraphicAttributes() {
return _attributes;
}
/**
* Returns whether this basic graphical element has a closed shape
* or not. By default always true. Subclasses may override
* this behaviour.
* @return true if the shape is closed.
*/
public boolean isClosed() {
return true;
}
}