Package org.flexdock.docking

Examples of org.flexdock.docking.Dockable


     * @see DockingManager#getDockable(Component)
     * @see #getRegionPreference(Dockable, String)
     * @see Dockable#getDockingProperties()
     */
    public float getRegionSize(Component c, String region) {
        Dockable d = DockingManager.getDockable(c);
        return getRegionPreference(d, region);
    }
View Full Code Here


     * @see DockingManager#getDockable(Component)
     * @see #getSiblingPreference(Dockable, String)
     * @see Dockable#getDockingProperties()
     */
    public float getSiblingSize(Component c, String region) {
        Dockable d = DockingManager.getDockable(c);
        return getSiblingPreference(d, region);
    }
View Full Code Here

*/
public class DockablePropertyChangeHandler implements PropertyChangeListener {
    public static final DockablePropertyChangeHandler DEFAULT_INSTANCE = new DockablePropertyChangeHandler();

    public void propertyChange(PropertyChangeEvent evt) {
        Dockable dockable = evt.getSource() instanceof Dockable? (Dockable)evt.getSource(): null;
        if(dockable==null)
            return;

        if (evt.getPropertyName().equals(DockablePropertySet.TAB_ICON)
                || evt.getPropertyName().equals(DockablePropertySet.DESCRIPTION)) {
            if (evt.getSource() instanceof Dockable) {
                DockingPort dockingPort = dockable.getDockingPort();
                if (dockingPort instanceof DefaultDockingPort) {
                    ((DefaultDockingPort) dockingPort).updateTab(dockable);
                }
            }
        } else if (DockablePropertySet.ACTIVE.equals(evt.getPropertyName())) {
View Full Code Here

        Element layoutElement = document.createElement(PersistenceConstants.LAYOUT_ELEMENT_NAME);

        Dockable[] dockables = layout.getDockables();
        ISerializer dockingStateSerializer = SerializerRegistry.getSerializer(DockingState.class);
        for (int i = 0; i < dockables.length; i++) {
            Dockable dockable = dockables[i];
            DockingState dockingState = layout.getDockingState(dockable);
            Element dockingStateElement = dockingStateSerializer.serialize(document, dockingState);
            layoutElement.appendChild(dockingStateElement);
        }
View Full Code Here

    public MainWindow() {
        super(Main.APP_NAME);
        initComponents();
        ActiveDockableTracker.getTracker(this).addPropertyChangeListener(new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent evt) {
                Dockable current = ActiveDockableTracker.getActiveDockable();
                if (current instanceof ScriptEditor)
                    editorFocused((ScriptEditor) current);
            }
        });
        SimpleAttributeSet out = new SimpleAttributeSet();
View Full Code Here

        for(String s: r)
            addRecent(s);
    }

    private void initToolWindows() {
        Dockable snippets;
        dock.dock(snippets = finaliseToolWindow(new SnippetManager()), DockingConstants.WEST_REGION);
        dock.dock((Dockable) (log = finaliseToolWindow(new LogWindow())), DockingConstants.SOUTH_REGION);
        DockingManager.setSplitProportion(snippets, 0.2f);
        DockingManager.setSplitProportion((Dockable) log, 0.7f);
        finaliseToolWindow(new MemoryUsageWindow());
View Full Code Here

        dispatchDockbarEvent(DockbarEvent.LOCKED);
    }


    private void dispatchDockbarEvent(int type) {
        Dockable dockable = manager.getActiveDockable();
        int edge = manager.getActiveEdge();
        DockbarEvent evt = new DockbarEvent(dockable, type, edge);
        EventManager.dispatch(evt);
    }
View Full Code Here

    public void propertyChange(PropertyChangeEvent evt) {
        if(!(evt.getSource() instanceof Dockable))
            return;

        Dockable dockable = (Dockable) evt.getSource();
        if(!DockingUtility.isMinimized(dockable))
            return;

        String pName = evt.getPropertyName();
        DockbarLabel label = getDockbarLabel(dockable);
        if(label==null)
            return;

        if (DockablePropertySet.TAB_ICON.equals(pName) || DockablePropertySet.DOCKBAR_ICON.equals(pName)) {
            Icon icon = dockable.getDockingProperties().getDockbarIcon();
            if(icon==null)
                icon = dockable.getDockingProperties().getTabIcon();
            label.setIcon(icon);
        } else if(DockablePropertySet.DESCRIPTION.equals(pName)) {
            label.setText(dockable.getDockingProperties().getDockableDesc());
        }
    }
View Full Code Here

     * @see #isPolicyFloatingSupported(Dockable)
     * @see #FLOATING_ALLOWED
     */
    public void dragStarted(DockingEvent evt) {
        Map context = evt.getDragContext();
        Dockable d = evt.getDockable();
        Boolean allowed = isPolicyFloatingSupported(d) ? Boolean.TRUE
                          : Boolean.FALSE;
        context.put(FLOATING_ALLOWED, allowed);
    }
View Full Code Here

    public String getRegion(Point location) {
        if (location == null)
            return UNKNOWN_REGION;

        RegionChecker regionChecker = getRegionChecker();
        Dockable d = getDockableAt(location);
        Component regionTest = this;

        if (d != null) {
            regionTest = d.getComponent();
            location = SwingUtilities.convertPoint(this, location, regionTest);
        }

        return regionChecker.getRegion(regionTest, location);
    }
View Full Code Here

TOP

Related Classes of org.flexdock.docking.Dockable

Copyright © 2018 www.massapicom. 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.