001    /**
002     * planningtool - A Planning Tool with Critiquing Support.
003     * 
004     * Copyright (C) 2006 olale
005    
006     * This program is free software; you can redistribute it and/or
007     * modify it under the terms of the GNU General Public License
008     * as published by the Free Software Foundation; either version 2
009     * of the License, or (at your option) any later version.
010    
011     * This program is distributed in the hope that it will be useful,
012     * but WITHOUT ANY WARRANTY; without even the implied warranty of
013     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014     * GNU General Public License for more details.
015    
016     * You should have received a copy of the GNU General Public License
017     * along with this program; if not, write to the Free Software
018     * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
019    
020     * Contact information: 
021     * E-mail: olale@ida.liu.se
022     *         olale@lysator.liu.se
023     */
024    package se.liu.ida.critiquer.constraints;
025    
026    import java.awt.Color;
027    import java.io.Serializable;
028    import java.util.List;
029    
030    import se.liu.ida.critiquer.gui.View;
031    import se.liu.ida.critiquer.gui.ViewRenderingListener;
032    
033    /**
034     * Visual constraints can be rendered on top of the views and also have colors
035     * that the user may modify.
036     * 
037     * Currently, every constraint has only one color associated with
038     */
039    
040    public interface VisualConstraint extends ViewRenderingListener, Serializable {
041    
042            public Color getColor();
043    
044            public void setColor(Color c);
045    
046            public List<Class<? extends View>> getApplicableViews();
047    
048            public boolean isApplicableFor(View view);
049            
050            /**
051             * Toggles the active state of this constraint on and off. This does not affect
052             * that updates that this constraint gets from the activities though
053             * 
054             * @param active
055             */
056            public void setActive(boolean active);
057    
058            /**
059             * Should this constraint be displayed?
060             * 
061             * @return true iff this constraint should be displayed
062             */
063            
064            public boolean isActive();
065    }