All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bibliothek.gui.DockTheme Maven / Gradle / Ivy

The newest version!
/*
 * Bibliothek - DockingFrames
 * Library built on Java/Swing, allows the user to "drag and drop"
 * panels containing any Swing-Component the developer likes to add.
 * 
 * Copyright (C) 2007 Benjamin Sigg
 * 
 * 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 library 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.
 *
 * 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 * 
 * Benjamin Sigg
 * [email protected]
 * CH - Switzerland
 */

package bibliothek.gui;

import bibliothek.gui.dock.dockable.DefaultDockableMovingImageFactory;
import bibliothek.gui.dock.dockable.DockableMovingImageFactory;
import bibliothek.gui.dock.focus.DockableSelection;
import bibliothek.gui.dock.station.Combiner;
import bibliothek.gui.dock.station.DisplayerFactory;
import bibliothek.gui.dock.station.DockableDisplayer;
import bibliothek.gui.dock.station.StationPaint;
import bibliothek.gui.dock.station.span.DefaultSpanFactory;
import bibliothek.gui.dock.station.span.Span;
import bibliothek.gui.dock.station.span.SpanFactory;
import bibliothek.gui.dock.themes.DefaultDisplayerFactoryValue;
import bibliothek.gui.dock.themes.DefaultStationPaintValue;
import bibliothek.gui.dock.themes.DockThemeExtension;
import bibliothek.gui.dock.themes.StationCombinerValue;
import bibliothek.gui.dock.themes.ThemeCombiner;
import bibliothek.gui.dock.themes.ThemeDisplayerFactory;
import bibliothek.gui.dock.themes.ThemeDockableSelection;
import bibliothek.gui.dock.themes.ThemeManager;
import bibliothek.gui.dock.themes.ThemeStationPaint;
import bibliothek.gui.dock.themes.border.BorderModifier;
import bibliothek.gui.dock.title.DockTitle;
import bibliothek.gui.dock.title.DockTitleFactory;
import bibliothek.gui.dock.title.DockTitleManager;
import bibliothek.gui.dock.util.BackgroundPaint;
import bibliothek.gui.dock.util.DockProperties;
import bibliothek.gui.dock.util.Priority;
import bibliothek.gui.dock.util.PropertyKey;
import bibliothek.gui.dock.util.UIValue;
import bibliothek.gui.dock.util.property.ConstantPropertyFactory;
import bibliothek.gui.dock.util.property.DynamicPropertyFactory;
import bibliothek.util.FrameworkOnly;

/**
 * A theme describes how a {@link DockStation} looks like, which {@link DockTitle} are selected, and other behavior. 
 * A theme needs only to support one {@link DockController} at a time.
* Most of the methods of this interface should not be called by the client. Instead the {@link ThemeManager} and * the {@link DockProperties} should be used. To request a value from the {@link ThemeManager} the method * {@link ThemeManager#add(String, bibliothek.util.Path, bibliothek.gui.dock.util.TypedUIProperties.Type, UIValue) add} must * be used to install an observer (of type {@link UIValue}). The {@link PropertyKey}s specified in this interface may * be used directly, but clients should bear in mind that the {@link ThemeManager} can override resources that are * stored in the {@link DockProperties}. * @author Benjamin Sigg */ public interface DockTheme { /** * A unique identifier for the {@link DockProperties} to access the current {@link BackgroundPaint}. */ public static final PropertyKey BACKGROUND_PAINT = new PropertyKey( "dock.background" ); /** * A unique identifier for the {@link DockProperties} to access the current {@link BorderModifier}. */ public static final PropertyKey BORDER_MODIFIER = new PropertyKey( "dock.borderModifier" ); /** The factory creating {@link Span}s and ultimatively deciding how the animation looks like when dropping a {@link Dockable} */ public static final PropertyKey SPAN_FACTORY = new PropertyKey( "span factory", new ConstantPropertyFactory( new DefaultSpanFactory() ), true ); /** * Install this theme at controller. The theme * may change any properties it likes. * @param controller the controller * @param extensions a set of extensions specifically for this theme */ public void install( DockController controller, DockThemeExtension[] extensions ); /** * Uninstalls this theme from controller. The theme * has to remove all listeners it added. * @param controller the controller */ public void uninstall( DockController controller ); /** * A unique identifier for the {@link DockProperties} to access the current {@link Combiner}. The default * value will be derived from the current {@link DockTheme}. */ public static final PropertyKey COMBINER = new PropertyKey( "dock.combiner", new DynamicPropertyFactory(){ public Combiner getDefault( PropertyKey key, DockProperties properties ){ return new ThemeCombiner( properties.getController() ); } }, true ); /** * Gets the Combiner for station.
* This method should not be used directly, instead an {@link UIValue} of type {@link StationCombinerValue} should * be installed at the local {@link ThemeManager} to retrieve the value. * @param station the station whose combiner is searched * @return a combiner for station */ @FrameworkOnly public Combiner getCombiner( DockStation station ); /** * A unique identifier for the {@link DockProperties} to access the current {@link StationPaint}. The default * value will be derived from the current {@link DockTheme}. */ public static final PropertyKey STATION_PAINT = new PropertyKey( "dock.paint", new DynamicPropertyFactory(){ public StationPaint getDefault( PropertyKey key, DockProperties properties ){ return new ThemeStationPaint( properties.getController() ); } }, true ); /** * Gets the paint which is used to draw things onto station.
* This method should not be used directly, instead an {@link UIValue} of type {@link DefaultStationPaintValue} should * be installed at the local {@link ThemeManager} to retrieve the value. * @param station the station to paint on * @return the paint for station */ @FrameworkOnly public StationPaint getPaint( DockStation station ); /** * A unique identifier for the {@link DockProperties} to access the current {@link DisplayerFactory}. The default * value will be derived from the current {@link DockTheme}. */ public static final PropertyKey DISPLAYER_FACTORY = new PropertyKey( "dock.displayerFactory", new DynamicPropertyFactory(){ public DisplayerFactory getDefault( PropertyKey key, DockProperties properties ){ return new ThemeDisplayerFactory( properties.getController() ); } }, true ); /** * Gets a displayer factory for station.
* This method should not be used directly, instead an {@link UIValue} of type {@link DefaultDisplayerFactoryValue} should * be installed at the local {@link ThemeManager} to retrieve the value. * @param station the station on which the created {@link DockableDisplayer} * is shown * @return the factory to create displayer */ @FrameworkOnly public DisplayerFactory getDisplayFactory( DockStation station ); /** * Gets the default {@link DockTitleFactory} which is used if no other factory is set.
* The result of this method is installed in the {@link DockTitleManager} using * the key {@link DockTitleManager#THEME_FACTORY_ID} and priority {@link Priority#THEME}. A * theme may use the manager to change the factory at any time. * @param controller the controller using this theme * @return the factory */ public DockTitleFactory getTitleFactory( DockController controller ); /** * Identifier for the {@link DockableMovingImageFactory} that is used to show an image during * drag and drop operations. */ public static final PropertyKey DOCKABLE_MOVING_IMAGE_FACTORY = new PropertyKey( "dock.movingImageFactory", new DynamicPropertyFactory(){ public DockableMovingImageFactory getDefault( PropertyKey key, DockProperties properties ){ return new DefaultDockableMovingImageFactory( properties.getController() ); } } , true ); /** * Gets a factory for images which are moved around by the user.
* This method should not be invoked directly, instead the property key {@link #DOCKABLE_MOVING_IMAGE_FACTORY} * should be used. * @param controller the controller for which the factory is needed * @return a factory */ @FrameworkOnly public DockableMovingImageFactory getMovingImageFactory( DockController controller ); /** * Identifier for the {@link DockableSelection}, a panel that is shown to select a {@link Dockable} * using only the keyboard. */ public static final PropertyKey DOCKABLE_SELECTION = new PropertyKey( "dock.dockableSelection", new DynamicPropertyFactory(){ public DockableSelection getDefault( PropertyKey key, DockProperties properties ){ return new ThemeDockableSelection( properties.getController() ); } }, true ); /** * Gets a selector for {@link Dockable}s. This method should not be invoked directly, instead * the property key {@link #DOCKABLE_SELECTION} should be used. * @param controller the controller for which the selector will be used * @return the selector */ @FrameworkOnly public DockableSelection getDockableSelection( DockController controller ); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy