├── .gitignore ├── .travis.yml ├── LICENSE.txt ├── README ├── README-BUILD.md ├── check_style.xml ├── docs ├── User Guide.doc ├── User Guide.pdf ├── UserGuideOutline.txt ├── User_Guide.sxw └── images │ ├── after_docking.JPG │ ├── alpha_preview.JPG │ ├── before_docking.JPG │ ├── eclipse001.png │ ├── ghost_preview.JPG │ ├── rubber_band.JPG │ ├── vsnet-laf.png │ └── xor_preview.JPG ├── flexdock-core ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── flexdock │ │ │ ├── docking │ │ │ ├── Dockable.java │ │ │ ├── DockableFactory.java │ │ │ ├── DockingConstants.java │ │ │ ├── DockingManager.java │ │ │ ├── DockingPort.java │ │ │ ├── DockingStrategy.java │ │ │ ├── DockingStub.java │ │ │ ├── RegionChecker.java │ │ │ ├── activation │ │ │ │ ├── ActiveDockableListener.java │ │ │ │ └── ActiveDockableTracker.java │ │ │ ├── adapter │ │ │ │ ├── AdapterFactory.java │ │ │ │ ├── AdapterMapping.java │ │ │ │ ├── DockingAdapter.java │ │ │ │ └── MappingReader.java │ │ │ ├── defaults │ │ │ │ ├── AbstractDockable.java │ │ │ │ ├── BorderManager.java │ │ │ │ ├── DefaultDockingPort.java │ │ │ │ ├── DefaultDockingStrategy.java │ │ │ │ ├── DefaultRegionChecker.java │ │ │ │ ├── DockableComponentWrapper.java │ │ │ │ ├── DockablePropertyChangeHandler.java │ │ │ │ ├── DockingSplitPane.java │ │ │ │ └── StandardBorderManager.java │ │ │ ├── drag │ │ │ │ ├── DragGlasspane.java │ │ │ │ ├── DragManager.java │ │ │ │ ├── DragOperation.java │ │ │ │ ├── DragPipeline.java │ │ │ │ └── effects │ │ │ │ │ ├── DefaultPreview.java │ │ │ │ │ ├── DragPreview.java │ │ │ │ │ ├── EffectsManager.java │ │ │ │ │ └── RubberBand.java │ │ │ ├── event │ │ │ │ ├── DockingEvent.java │ │ │ │ ├── DockingEventHandler.java │ │ │ │ ├── DockingListener.java │ │ │ │ ├── DockingMonitor.java │ │ │ │ ├── TabbedDragListener.java │ │ │ │ └── hierarchy │ │ │ │ │ ├── DockingPortTracker.java │ │ │ │ │ └── RootDockingPortInfo.java │ │ │ ├── floating │ │ │ │ ├── frames │ │ │ │ │ ├── DockingFrame.java │ │ │ │ │ ├── FloatingDockingPort.java │ │ │ │ │ ├── FrameDragListener.java │ │ │ │ │ ├── RootPane.java │ │ │ │ │ ├── RootPaneBorder.java │ │ │ │ │ └── RootPaneLayout.java │ │ │ │ └── policy │ │ │ │ │ ├── DefaultFloatPolicy.java │ │ │ │ │ ├── FloatPolicy.java │ │ │ │ │ └── FloatPolicyManager.java │ │ │ ├── package.html │ │ │ ├── props │ │ │ │ ├── BasicDockablePropertySet.java │ │ │ │ ├── BasicDockingPortPropertySet.java │ │ │ │ ├── DockablePropertySet.java │ │ │ │ ├── DockingPortPropertySet.java │ │ │ │ ├── PropertyChangeListenerFactory.java │ │ │ │ ├── PropertyManager.java │ │ │ │ ├── RootDockablePropertySet.java │ │ │ │ ├── RootDockingPortPropertySet.java │ │ │ │ ├── ScopedDockablePropertySet.java │ │ │ │ ├── ScopedDockingPortPropertySet.java │ │ │ │ └── ScopedMap.java │ │ │ └── state │ │ │ │ ├── DockingPath.java │ │ │ │ ├── DockingState.java │ │ │ │ ├── FloatManager.java │ │ │ │ ├── FloatingGroup.java │ │ │ │ ├── LayoutManager.java │ │ │ │ ├── LayoutNode.java │ │ │ │ ├── MinimizationManager.java │ │ │ │ ├── PersistenceException.java │ │ │ │ └── tree │ │ │ │ ├── DockableNode.java │ │ │ │ ├── DockingNode.java │ │ │ │ ├── DockingPortNode.java │ │ │ │ └── SplitNode.java │ │ │ ├── event │ │ │ ├── Event.java │ │ │ ├── EventHandler.java │ │ │ ├── EventManager.java │ │ │ ├── RegistrationEvent.java │ │ │ ├── RegistrationHandler.java │ │ │ └── RegistrationListener.java │ │ │ └── util │ │ │ ├── ClassMapping.java │ │ │ ├── DockingUtility.java │ │ │ ├── LookAndFeelSettings.java │ │ │ ├── NestedComponents.java │ │ │ ├── OsInfo.java │ │ │ ├── ResourceManager.java │ │ │ ├── RootWindow.java │ │ │ ├── SwingUtility.java │ │ │ ├── TypedHashtable.java │ │ │ └── Utilities.java │ └── resources │ │ └── org │ │ └── flexdock │ │ ├── docking │ │ ├── defaults │ │ │ ├── downArrow.gif │ │ │ ├── emptyIcon.gif │ │ │ ├── leftArrow.gif │ │ │ ├── notAllowed.gif │ │ │ ├── rightArrow.gif │ │ │ ├── stacked.gif │ │ │ └── upArrow.gif │ │ ├── drag │ │ │ ├── effects │ │ │ │ └── drag-effects.xml │ │ │ └── outline │ │ │ │ ├── win32 │ │ │ │ └── RubberBand.dll │ │ │ │ └── xlib │ │ │ │ └── libRubberBand.so │ │ └── flexdock-core.properties │ │ └── util │ │ ├── dev-props.properties │ │ ├── laf-defaults.xml │ │ └── os-info.xml │ └── test │ └── java │ └── org │ └── flexdock │ └── test │ └── xml │ └── XMLDebugger.java ├── flexdock-demo ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── flexdock │ │ ├── demos │ │ ├── AllDemos.java │ │ ├── maximizing │ │ │ ├── DockableSimpleInternalFrame.java │ │ │ ├── MaximizationDemo.java │ │ │ ├── MyDockingPort.java │ │ │ └── SimpleInternalFrame.java │ │ ├── perspective │ │ │ ├── PerspectivesDemo.java │ │ │ └── XMLPerspectivesDemo.java │ │ ├── raw │ │ │ ├── CompoundDemo.java │ │ │ ├── SimpleDemo.java │ │ │ ├── SplitPaneDemo.java │ │ │ ├── TabbedPaneDemo.java │ │ │ ├── adapter │ │ │ │ └── AdapterDemo.java │ │ │ ├── border │ │ │ │ ├── BorderDemo.java │ │ │ │ ├── DemoBorderManager.java │ │ │ │ └── DockablePanel.java │ │ │ ├── elegant │ │ │ │ ├── DockableImpl.java │ │ │ │ ├── ElegantDemo.java │ │ │ │ └── ElegantPanel.java │ │ │ └── jmf │ │ │ │ ├── JMFDemo.java │ │ │ │ └── MediaPanel.java │ │ ├── util │ │ │ ├── DemoUtility.java │ │ │ ├── DockableTitlepane.java │ │ │ ├── DockingStubTitlepane.java │ │ │ ├── GradientPainter.java │ │ │ ├── GradientTitlebar.java │ │ │ ├── Titlebar.java │ │ │ ├── Titlepane.java │ │ │ └── VSNetStartPage.java │ │ └── view │ │ │ └── ViewDemo.java │ │ └── test │ │ ├── SiblingTest.java │ │ ├── dockbar │ │ ├── BasicDockbarTest.java │ │ └── ComplexDockbarTest.java │ │ ├── perspective │ │ ├── FocusTest.java │ │ └── ViewRestorationTest.java │ │ └── view │ │ └── ViewFrameTest.java │ └── resources │ ├── aquathemepack.zip │ ├── fish.mov │ ├── lung02a.mov │ ├── org │ └── flexdock │ │ └── demos │ │ ├── maximizing │ │ └── maximize.gif │ │ ├── raw │ │ └── adapter │ │ │ └── docking-adapter.xml │ │ └── view │ │ ├── birdView001.png │ │ ├── console001.png │ │ ├── ms_misc_icons001.png │ │ ├── ms_tabs001.png │ │ ├── msgLog001.png │ │ ├── problems001.png │ │ └── titlebar │ │ └── msvs001.png │ ├── quickSilverRthemepack.zip │ └── themepack.zip ├── flexdock-drag ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── flexdock │ │ └── docking │ │ └── drag │ │ └── preview │ │ ├── AlphaPreview.java │ │ ├── GhostPreview.java │ │ └── XORPreview.java │ └── test │ └── java │ └── org │ └── flexdock │ └── test │ └── drag │ └── RubberBandTest.java ├── flexdock-perspective ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── flexdock │ └── perspective │ ├── DockingStateListener.java │ ├── Layout.java │ ├── LayoutBuilder.java │ ├── LayoutSequence.java │ ├── Perspective.java │ ├── PerspectiveFactory.java │ ├── PerspectiveManager.java │ ├── RestorationManager.java │ ├── actions │ └── OpenPerspectiveAction.java │ ├── event │ ├── LayoutEvent.java │ ├── LayoutEventHandler.java │ ├── LayoutListener.java │ ├── PerspectiveEvent.java │ ├── PerspectiveEventHandler.java │ ├── PerspectiveListener.java │ ├── RegistrationEvent.java │ ├── RegistrationHandler.java │ └── RegistrationListener.java │ ├── persist │ ├── DefaultFilePersister.java │ ├── FilePersistenceHandler.java │ ├── PersistenceHandler.java │ ├── Persister.java │ ├── PerspectiveModel.java │ └── xml │ │ ├── AbstractLayoutNodeSerializer.java │ │ ├── DimensionSerializer.java │ │ ├── DockableNodeSerializer.java │ │ ├── DockingPathSerializer.java │ │ ├── DockingPortNodeSerializer.java │ │ ├── DockingStateSerializer.java │ │ ├── FloatingGroupSerializer.java │ │ ├── ISerializer.java │ │ ├── LayoutNodeSerializer.java │ │ ├── LayoutSequenceSerializer.java │ │ ├── LayoutSerializer.java │ │ ├── PersistenceConstants.java │ │ ├── PerspectiveModelSerializer.java │ │ ├── PerspectiveSerializer.java │ │ ├── PointSerializer.java │ │ ├── RectangleSerializer.java │ │ ├── SerializerRegistry.java │ │ ├── SplitNodeSerializer.java │ │ ├── XMLPersister.java │ │ └── schema.xsd │ └── restore │ └── handlers │ ├── AlreadyRestoredHandler.java │ ├── DockPathHandler.java │ ├── FloatingHandler.java │ ├── MinimizedHandler.java │ ├── PointHandler.java │ ├── RelativeHandler.java │ ├── RestorationHandler.java │ └── UnknownStateHandler.java ├── flexdock-view ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── flexdock │ │ │ ├── dockbar │ │ │ ├── Dockbar.java │ │ │ ├── DockbarLabel.java │ │ │ ├── DockbarManager.java │ │ │ ├── MinimizationAdapter.java │ │ │ ├── StatusDockbar.java │ │ │ ├── ViewPane.java │ │ │ ├── activation │ │ │ │ ├── ActivationQueue.java │ │ │ │ ├── ActiveDockableHandler.java │ │ │ │ └── Animation.java │ │ │ ├── event │ │ │ │ ├── ActivationListener.java │ │ │ │ ├── DockablePropertyChangeHandler.java │ │ │ │ ├── DockbarEvent.java │ │ │ │ ├── DockbarEventHandler.java │ │ │ │ ├── DockbarListener.java │ │ │ │ ├── DockbarTracker.java │ │ │ │ └── ResizeListener.java │ │ │ ├── layout │ │ │ │ ├── DockbarLayout.java │ │ │ │ ├── DockbarLayoutManager.java │ │ │ │ └── InsetBorder.java │ │ │ └── util │ │ │ │ └── TextIcon.java │ │ │ ├── plaf │ │ │ ├── Configurator.java │ │ │ ├── FlexViewComponentUI.java │ │ │ ├── IFlexViewComponentUI.java │ │ │ ├── PlafManager.java │ │ │ ├── PropertySet.java │ │ │ ├── XMLConstants.java │ │ │ ├── common │ │ │ │ └── border │ │ │ │ │ ├── CompoundEmptyBorder.java │ │ │ │ │ ├── RoundedLineBorder.java │ │ │ │ │ ├── ShadowBorder.java │ │ │ │ │ └── SlideoutBorder.java │ │ │ ├── icons │ │ │ │ ├── IconMap.java │ │ │ │ ├── IconResource.java │ │ │ │ └── IconResourceFactory.java │ │ │ ├── mappings │ │ │ │ ├── PlafMappingFactory.java │ │ │ │ ├── RefResolver.java │ │ │ │ └── SkinLFResolver.java │ │ │ ├── resources │ │ │ │ ├── ActionResourceHandler.java │ │ │ │ ├── ColorResourceHandler.java │ │ │ │ ├── ConstructorHandler.java │ │ │ │ ├── FontResourceHandler.java │ │ │ │ ├── ImageIconResourceHandler.java │ │ │ │ ├── ImageResourceHandler.java │ │ │ │ ├── InsetsResourceHandler.java │ │ │ │ ├── PainterResourceHandler.java │ │ │ │ ├── PlafResourceHandler.java │ │ │ │ ├── ResourceHandler.java │ │ │ │ ├── ResourceHandlerFactory.java │ │ │ │ ├── StringResourceHandler.java │ │ │ │ ├── action │ │ │ │ │ └── DefaultAction.java │ │ │ │ ├── border │ │ │ │ │ ├── RaisedBorderResource.java │ │ │ │ │ ├── RoundedBorderResource.java │ │ │ │ │ └── SquareBevelBorderResource.java │ │ │ │ └── paint │ │ │ │ │ ├── DefaultPainter.java │ │ │ │ │ ├── GradientPainter.java │ │ │ │ │ ├── Painter.java │ │ │ │ │ └── PainterResource.java │ │ │ └── theme │ │ │ │ ├── ButtonUI.java │ │ │ │ ├── Theme.java │ │ │ │ ├── TitlebarUI.java │ │ │ │ ├── UIFactory.java │ │ │ │ ├── ViewUI.java │ │ │ │ ├── eclipse2 │ │ │ │ └── EclipseGradientPainter.java │ │ │ │ ├── metal │ │ │ │ ├── MetalPainter.java │ │ │ │ └── MetalTitlebarUI.java │ │ │ │ ├── officexp │ │ │ │ └── OfficeXPPainter.java │ │ │ │ └── skinlf │ │ │ │ ├── SkinLFPainter.java │ │ │ │ └── SkinLFTitlebarUI.java │ │ │ └── view │ │ │ ├── Button.java │ │ │ ├── Titlebar.java │ │ │ ├── View.java │ │ │ ├── ViewProps.java │ │ │ ├── Viewport.java │ │ │ ├── actions │ │ │ ├── ActionFactory.java │ │ │ ├── DefaultCloseAction.java │ │ │ ├── DefaultDisplayAction.java │ │ │ ├── DefaultPinAction.java │ │ │ └── ViewAction.java │ │ │ └── model │ │ │ └── ViewButtonModel.java │ └── resources │ │ └── org │ │ └── flexdock │ │ └── plaf │ │ ├── flexdock-themes-default.xml │ │ └── titlebar │ │ ├── eclipse2 │ │ ├── close_default.gif │ │ ├── min_default.gif │ │ └── pin_default.gif │ │ └── win32 │ │ ├── close_active.png │ │ ├── close_default.gif │ │ ├── close_default.png │ │ ├── close_disabled_active.png │ │ ├── close_disabled_default.png │ │ ├── min_default.gif │ │ ├── pin_active.png │ │ ├── pin_active_selected.png │ │ ├── pin_default.gif │ │ ├── pin_default.png │ │ ├── pin_default_selected.png │ │ ├── pin_disabled_active.png │ │ ├── pin_disabled_active_selected.png │ │ ├── pin_disabled_default.png │ │ └── pin_disabled_default_selected.png │ └── test │ └── java │ └── org │ └── flexdock │ └── test │ └── view │ └── ViewTest.java ├── pom.xml ├── release-notes.txt └── webstart └── flexdockdemo.jnlp /.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /flexdock-core/target/ 3 | /flexdock-demo/target/ 4 | /flexdock-view/target/ 5 | /flexdock-drag/target/ 6 | /flexdock-perspective/target/ 7 | /flexdock-dockbar/target/ 8 | flexdock-demo/dependency-reduced-pom.xml 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | 3 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy of 2 | this software and associated documentation files (the "Software"), to deal in the 3 | Software without restriction, including without limitation the rights to use, 4 | copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 5 | Software, and to permit persons to whom the Software is furnished to do so, subject 6 | to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in all 9 | copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 12 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 13 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 14 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 15 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 16 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 17 | 18 | This product includes software developed by 19 | The Apache Software Foundation (http://www.apache.org/). 20 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | This is the readme for the binary distribution. If you want to use the 2 | sources to build and run flexdock demos, then see README-BUILD. 3 | 4 | Contents 5 | ------------ 6 | The contents of the binary distributions are: 7 | 8 | LICENSE.txt the license statement 9 | README this file 10 | flexdock-.jar the flexdock framework 11 | flexdock-demo-.jar runnable jar containing demo apps 12 | release-notes.txt list of changes, fixes and new features 13 | docs\* user/developer documentation 14 | docs\apis\... javadocs 15 | jmf\* Java Media Framework used by the demo 16 | lib\* libraries used by this distribution 17 | 18 | Running the Demos 19 | --------------------- 20 | The demo jar requires both the flexdock-.jar and lib\*.jar. The 21 | manifest for the demo expects the flexdock-.jar to be in the same 22 | directory and all other dependencies to be located in a subdirectory lib. 23 | If you do not move any of the jars, you can run the demo jar using: 24 | 25 | java -jar flexdock-demo-.jar 26 | 27 | or if your GUI shell supports running a jar file by clicking or double 28 | clicking on it's icon, then do that. 29 | -------------------------------------------------------------------------------- /README-BUILD.md: -------------------------------------------------------------------------------- 1 | Building Flexdock 2 | -------------------------- 3 | 4 | To build this project, obtain a copy of Apache's Maven from 5 | https://maven.apache.org. We recommend to use version 3.0 or later. 6 | 7 | From this directory you should be able to build everything by running 8 | the command 9 | 10 | mvn clean install 11 | 12 | This will install `flexdock` into your local maven cache. In order to use it in 13 | a `maven` project add 14 | 15 | 16 | org.flexdock 17 | flexdock-core 18 | 1.3 19 | jar 20 | 21 | 22 | com.jgoodies 23 | jgoodies-looks 24 | 2.7.0 25 | jar 26 | 27 | 28 | org.flexdock 29 | flexdock-view 30 | 1.3 31 | jar 32 | 33 | 34 | org.flexdock 35 | flexdock-perspective 36 | 1.3 37 | jar 38 | 39 | 40 | org.flexdock 41 | flexdock-drag 42 | 1.3 43 | jar 44 | 45 | 46 | Running The Demos 47 | -------------------------- 48 | 49 | Simply run 50 | 51 | cd flexdock-demo 52 | mvn package 53 | java -jar flexdock-demo/target/flexdock-demo-1.3.jar 54 | 55 | which will run a launcher for all available demos. 56 | -------------------------------------------------------------------------------- /docs/User Guide.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/docs/User Guide.doc -------------------------------------------------------------------------------- /docs/User Guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/docs/User Guide.pdf -------------------------------------------------------------------------------- /docs/UserGuideOutline.txt: -------------------------------------------------------------------------------- 1 | Introduction 2 | What is a Docking Framework? 3 | Common Docking Frameworks and Features 4 | What is FlexDock? 5 | FlexDock Components 6 | Demo Applications 7 | 8 | Basic Concepts 9 | Dockable, DockingPort, and DockingManager 10 | Regions and Docking Layout 11 | Drag-n-Drop 12 | Programmatic Docking API 13 | Event Handling 14 | Creating a Working Example 15 | 16 | Working with Raw Dockables 17 | User-Provided Methods 18 | Framework-Provided Method Implementations 19 | Creating a Layout 20 | Managing Nested Borders 21 | Using a DockableFactory 22 | Creating a Working Example 23 | 24 | Working with Views 25 | What is a View? 26 | Adding User Content 27 | Adding View Actions 28 | Defining View Actions 29 | Changing the Theme 30 | Creating a Working Example 31 | 32 | Managing Docking State 33 | Working with Minimization 34 | Working with Floating 35 | Working with the LayoutManager 36 | Persisting Docking State 37 | Creating a Working Example 38 | 39 | Minimization and Collapsible Toolbars 40 | Dockbar as a Minimization Manager 41 | Dockbar Edges and Constraints 42 | Dockable Preview 43 | Dockable Restoration 44 | Creating a Working Example 45 | 46 | Working with Perspectives 47 | Perspectives as a LayoutManager 48 | Using a PerspectiveFactory 49 | Customizing Persistence Location 50 | Customizing Persistence Format 51 | Creating a Working Example 52 | -------------------------------------------------------------------------------- /docs/User_Guide.sxw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/docs/User_Guide.sxw -------------------------------------------------------------------------------- /docs/images/after_docking.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/docs/images/after_docking.JPG -------------------------------------------------------------------------------- /docs/images/alpha_preview.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/docs/images/alpha_preview.JPG -------------------------------------------------------------------------------- /docs/images/before_docking.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/docs/images/before_docking.JPG -------------------------------------------------------------------------------- /docs/images/eclipse001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/docs/images/eclipse001.png -------------------------------------------------------------------------------- /docs/images/ghost_preview.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/docs/images/ghost_preview.JPG -------------------------------------------------------------------------------- /docs/images/rubber_band.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/docs/images/rubber_band.JPG -------------------------------------------------------------------------------- /docs/images/vsnet-laf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/docs/images/vsnet-laf.png -------------------------------------------------------------------------------- /docs/images/xor_preview.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/docs/images/xor_preview.JPG -------------------------------------------------------------------------------- /flexdock-core/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | org.flexdock 6 | flexdock 7 | 1.3 8 | 9 | flexdock-core 10 | 1.3 11 | jar 12 | 13 | ${project.artifactId} 14 | ${project.name} 15 | 16 | 17 | 18 | net.sf.squirrel-sql.thirdparty-non-maven 19 | skinlf 20 | 6.7 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /flexdock-core/src/main/java/org/flexdock/docking/drag/effects/DragPreview.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.docking.drag.effects; 21 | 22 | import java.awt.Component; 23 | import java.awt.Graphics2D; 24 | import java.awt.Polygon; 25 | import java.util.Map; 26 | 27 | import org.flexdock.docking.Dockable; 28 | import org.flexdock.docking.DockingConstants; 29 | import org.flexdock.docking.DockingPort; 30 | 31 | public interface DragPreview extends DockingConstants { 32 | public Polygon createPreviewPolygon(Component dockable, DockingPort port, Dockable hover, String targetRegion, Component paintingTarget, Map dragInfo); 33 | public void drawPreview(Graphics2D g, Polygon poly, Dockable dockable, Map dragInfo); 34 | } 35 | -------------------------------------------------------------------------------- /flexdock-core/src/main/java/org/flexdock/docking/drag/effects/RubberBand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.docking.drag.effects; 21 | 22 | import java.awt.Color; 23 | import java.awt.Graphics; 24 | import java.awt.Rectangle; 25 | 26 | /** 27 | * @author Christopher Butler 28 | * 29 | */ 30 | public class RubberBand { 31 | public static final String DEBUG_OUTPUT = "rubberband.debug"; 32 | 33 | public void paint(Graphics g, int x, int y, int width, int height) { 34 | paint(g, new Rectangle(x, y, width, height)); 35 | } 36 | 37 | public void paint(int x, int y, int width, int height) { 38 | paint(new Rectangle(x, y, width, height)); 39 | } 40 | 41 | public void paint(Rectangle r) { 42 | paint(null, r); 43 | } 44 | 45 | public void paint(Graphics g, Rectangle r) { 46 | if(g==null || r==null || true) { 47 | return; 48 | } 49 | 50 | g.setXORMode(Color.BLACK); 51 | g.drawRect(r.x, r.y, r.width, r.height); 52 | g.setXORMode(null); 53 | } 54 | 55 | public void clear() { 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /flexdock-core/src/main/java/org/flexdock/docking/event/DockingMonitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.docking.event; 21 | 22 | /** 23 | * @author Christopher Butler 24 | */ 25 | public interface DockingMonitor { 26 | 27 | void addDockingListener(DockingListener listener); 28 | 29 | void removeDockingListener(DockingListener listener); 30 | 31 | DockingListener[] getDockingListeners(); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /flexdock-core/src/main/java/org/flexdock/docking/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Provides the specification for the FlexDock docking framework. 8 | 9 | 10 |

Package Specification

11 |

This package contains interface definitions for the FlexDock framework. It 12 | also contains the utility class DockingManager. This class helps 13 | to load the actual docking implementations and configure those instances. 14 |

15 |

16 | The package org.flexdock.docking.defaults contains default 17 | implementations for these interfaces. Implementors should use these classes as 18 | a reference, since a lot of time has been put into developing them. 19 |

20 | 21 | 22 | -------------------------------------------------------------------------------- /flexdock-core/src/main/java/org/flexdock/docking/props/DockingPortPropertySet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.docking.props; 21 | 22 | import org.flexdock.docking.RegionChecker; 23 | 24 | /** 25 | * @author Christopher Butler 26 | */ 27 | public interface DockingPortPropertySet { 28 | public static final String REGION_CHECKER = "DockingPort.REGION_CHECKER"; 29 | public static final String SINGLE_TABS = "DockingPort.SINGLE_TABS"; 30 | public static final String TAB_PLACEMENT = "DockingPort.TAB_PLACEMENT"; 31 | 32 | public static final String REGION_SIZE_NORTH = "DockingPort.REGION_SIZE_NORTH"; 33 | public static final String REGION_SIZE_SOUTH = "DockingPort.REGION_SIZE_SOUTH"; 34 | public static final String REGION_SIZE_EAST = "DockingPort.REGION_SIZE_EAST"; 35 | public static final String REGION_SIZE_WEST = "DockingPort.REGION_SIZE_WEST"; 36 | 37 | public RegionChecker getRegionChecker(); 38 | 39 | public Boolean isSingleTabsAllowed(); 40 | 41 | public Integer getTabPlacement(); 42 | 43 | public Float getRegionInset(String region); 44 | 45 | public void setRegionChecker(RegionChecker checker); 46 | 47 | public void setSingleTabsAllowed(boolean allowed); 48 | 49 | public void setTabPlacement(int placement); 50 | 51 | public void setRegionInset(String region, float inset); 52 | 53 | } 54 | -------------------------------------------------------------------------------- /flexdock-core/src/main/java/org/flexdock/docking/props/PropertyChangeListenerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.docking.props; 21 | 22 | import java.beans.PropertyChangeListener; 23 | import java.util.ArrayList; 24 | import java.util.Iterator; 25 | import java.util.Vector; 26 | 27 | /** 28 | * @author Christopher Butler 29 | */ 30 | public abstract class PropertyChangeListenerFactory { 31 | private static final Vector FACTORIES = new Vector(); 32 | 33 | public static void addFactory(PropertyChangeListenerFactory factory) { 34 | if(factory!=null) { 35 | FACTORIES.add(factory); 36 | } 37 | } 38 | 39 | public static void removeFactory(PropertyChangeListenerFactory factory) { 40 | if(factory!=null) { 41 | FACTORIES.remove(factory); 42 | } 43 | } 44 | 45 | public static PropertyChangeListener[] getListeners() { 46 | ArrayList list = new ArrayList(FACTORIES.size()); 47 | for(Iterator it=FACTORIES.iterator(); it.hasNext();) { 48 | PropertyChangeListenerFactory factory = (PropertyChangeListenerFactory)it.next(); 49 | PropertyChangeListener listener = factory.getListener(); 50 | if(listener!=null) { 51 | list.add(listener); 52 | } 53 | } 54 | return (PropertyChangeListener[])list.toArray(new PropertyChangeListener[list.size()]); 55 | } 56 | 57 | public abstract PropertyChangeListener getListener(); 58 | } 59 | -------------------------------------------------------------------------------- /flexdock-core/src/main/java/org/flexdock/docking/props/RootDockingPortPropertySet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.docking.props; 21 | 22 | import java.util.HashSet; 23 | 24 | import javax.swing.JTabbedPane; 25 | 26 | import org.flexdock.docking.RegionChecker; 27 | import org.flexdock.docking.defaults.DefaultRegionChecker; 28 | 29 | /** 30 | * @author Christopher Butler 31 | */ 32 | @SuppressWarnings(value = { "serial" }) 33 | public class RootDockingPortPropertySet extends BasicDockingPortPropertySet { 34 | private static final RegionChecker DEFAULT_REGION_CHECKER = new DefaultRegionChecker(); 35 | private static final Integer DEFAULT_TAB_PLACEMENT = new Integer(JTabbedPane.BOTTOM); 36 | private static final Float DEFAULT_REGION_INSET = new Float(RegionChecker.DEFAULT_REGION_SIZE); 37 | 38 | private HashSet constraints; 39 | 40 | public RootDockingPortPropertySet() { 41 | super(5); 42 | constraints = new HashSet(5); 43 | 44 | initConstraint(REGION_CHECKER, DEFAULT_REGION_CHECKER); 45 | initConstraint(SINGLE_TABS, Boolean.FALSE); 46 | initConstraint(TAB_PLACEMENT, DEFAULT_TAB_PLACEMENT); 47 | 48 | initConstraint(REGION_SIZE_NORTH, DEFAULT_REGION_INSET); 49 | initConstraint(REGION_SIZE_SOUTH, DEFAULT_REGION_INSET); 50 | initConstraint(REGION_SIZE_EAST, DEFAULT_REGION_INSET); 51 | initConstraint(REGION_SIZE_WEST, DEFAULT_REGION_INSET); 52 | } 53 | 54 | private void initConstraint(Object key, Object value) { 55 | put(key, value); 56 | constraints.add(key); 57 | } 58 | 59 | @Override 60 | public synchronized Object remove(Object key) { 61 | return constraints.contains(key)? null: super.remove(key); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /flexdock-core/src/main/java/org/flexdock/docking/props/ScopedMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.docking.props; 21 | 22 | import java.util.List; 23 | import java.util.Map; 24 | 25 | /** 26 | * @author Christopher Butler 27 | */ 28 | public interface ScopedMap { 29 | public Map getRoot(); 30 | public List getDefaults(); 31 | public List getLocals(); 32 | public List getGlobals(); 33 | } 34 | -------------------------------------------------------------------------------- /flexdock-core/src/main/java/org/flexdock/docking/state/LayoutManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.docking.state; 21 | 22 | import java.io.IOException; 23 | 24 | import org.flexdock.docking.Dockable; 25 | import org.flexdock.docking.DockingPort; 26 | 27 | /** 28 | * @author Christopher Butler 29 | */ 30 | public interface LayoutManager { 31 | 32 | DockingState getDockingState(String dockableId); 33 | 34 | DockingState getDockingState(Dockable dockable); 35 | 36 | FloatManager getFloatManager(); 37 | 38 | LayoutNode createLayout(DockingPort port); 39 | 40 | boolean display(Dockable dockable); 41 | 42 | boolean store() throws IOException, PersistenceException; 43 | 44 | boolean store(String persistenceKey) throws IOException, PersistenceException; 45 | 46 | boolean load() throws IOException, PersistenceException; 47 | 48 | boolean load(String persistenceKey) throws IOException, PersistenceException; 49 | 50 | boolean restore(boolean loadFromStorage) throws IOException, PersistenceException; 51 | 52 | String getDefaultPersistenceKey(); 53 | 54 | void setDefaultPersistenceKey(String key); 55 | 56 | } 57 | -------------------------------------------------------------------------------- /flexdock-core/src/main/java/org/flexdock/docking/state/LayoutNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.docking.state; 21 | 22 | import java.io.Serializable; 23 | 24 | import javax.swing.tree.MutableTreeNode; 25 | 26 | /** 27 | * @author Christopher Butler 28 | */ 29 | public interface LayoutNode extends MutableTreeNode, Cloneable, Serializable { 30 | 31 | Object getUserObject(); 32 | 33 | Object getDockingObject(); 34 | 35 | void add(MutableTreeNode child); 36 | 37 | Object clone(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /flexdock-core/src/main/java/org/flexdock/docking/state/MinimizationManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.docking.state; 21 | 22 | import java.awt.Component; 23 | 24 | import org.flexdock.docking.Dockable; 25 | import org.flexdock.docking.DockingConstants; 26 | 27 | /** 28 | * @author Christopher Butler 29 | */ 30 | public interface MinimizationManager { 31 | 32 | MinimizationManager DEFAULT_STUB = new Stub(); 33 | 34 | int UNSPECIFIED_LAYOUT_CONSTRAINT = -1; 35 | 36 | int TOP = DockingConstants.TOP; 37 | 38 | int LEFT = DockingConstants.LEFT; 39 | 40 | int BOTTOM = DockingConstants.BOTTOM; 41 | 42 | int RIGHT = DockingConstants.RIGHT; 43 | 44 | int CENTER = DockingConstants.CENTER; 45 | 46 | boolean close(Dockable dockable); 47 | 48 | void preview(Dockable dockable, boolean locked); 49 | 50 | void setMinimized(Dockable dockable, boolean minimized, Component window, int constraint); 51 | 52 | class Stub implements MinimizationManager { 53 | @Override 54 | public boolean close(Dockable dockable) { 55 | return false; 56 | } 57 | 58 | @Override 59 | public void preview(Dockable dockable, boolean locked) {} 60 | 61 | @Override 62 | public void setMinimized(Dockable dockable, boolean minimized, Component window, int edge) {} 63 | 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /flexdock-core/src/main/java/org/flexdock/docking/state/PersistenceException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 17 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 18 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 19 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE. 20 | */ 21 | package org.flexdock.docking.state; 22 | 23 | /** 24 | * Created on 2005-07-03 25 | * 26 | * @author Mateusz Szczap 27 | * @version $Id: PersistenceException.java,v 1.1 2005-07-05 14:53:31 marius Exp $ 28 | */ 29 | @SuppressWarnings(value = { "serial" }) 30 | public class PersistenceException extends Exception { 31 | 32 | public PersistenceException(String message, Exception ex) { 33 | super(message, ex); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /flexdock-core/src/main/java/org/flexdock/docking/state/tree/DockableNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.docking.state.tree; 21 | 22 | import javax.swing.tree.MutableTreeNode; 23 | 24 | import org.flexdock.docking.Dockable; 25 | import org.flexdock.docking.DockingManager; 26 | 27 | /** 28 | * @author Christopher Butler 29 | */ 30 | public class DockableNode extends DockingNode { 31 | 32 | private String dockableId; 33 | 34 | public DockableNode() { 35 | } 36 | 37 | private DockableNode(String id) { 38 | dockableId = id; 39 | } 40 | 41 | public String getDockableId() { 42 | return dockableId; 43 | } 44 | 45 | public void setDockableId(String dockableId) { 46 | this.dockableId = dockableId; 47 | } 48 | 49 | public Dockable getDockable() { 50 | return DockingManager.getDockable(dockableId); 51 | } 52 | 53 | @Override 54 | public void add(MutableTreeNode newChild) { 55 | // noop 56 | } 57 | 58 | @Override 59 | public Object getDockingObject() { 60 | return getDockable(); 61 | } 62 | 63 | @Override 64 | protected DockingNode shallowClone() { 65 | return new DockableNode(dockableId); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /flexdock-core/src/main/java/org/flexdock/docking/state/tree/DockingNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.docking.state.tree; 21 | 22 | import java.util.Enumeration; 23 | 24 | import javax.swing.tree.DefaultMutableTreeNode; 25 | 26 | import org.flexdock.docking.DockingConstants; 27 | import org.flexdock.docking.state.LayoutNode; 28 | 29 | /** 30 | * @author Christopher Butler 31 | */ 32 | public abstract class DockingNode extends DefaultMutableTreeNode implements LayoutNode, DockingConstants { 33 | 34 | @Override 35 | public Object getUserObject() { 36 | Object obj = super.getUserObject(); 37 | if(obj==null) { 38 | obj = getDockingObject(); 39 | setUserObject(obj); 40 | } 41 | return obj; 42 | } 43 | 44 | @Override 45 | public abstract Object getDockingObject(); 46 | 47 | protected abstract DockingNode shallowClone(); 48 | 49 | @Override 50 | public Object clone() { 51 | return deepClone(); 52 | } 53 | 54 | public DockingNode deepClone() { 55 | DockingNode clone = shallowClone(); 56 | for(Enumeration en=children(); en.hasMoreElements();) { 57 | DockingNode child = (DockingNode)en.nextElement(); 58 | clone.add(child.deepClone()); 59 | } 60 | return clone; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /flexdock-core/src/main/java/org/flexdock/docking/state/tree/DockingPortNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.docking.state.tree; 21 | 22 | import javax.swing.tree.DefaultMutableTreeNode; 23 | import javax.swing.tree.TreeNode; 24 | 25 | import org.flexdock.docking.DockingPort; 26 | import org.flexdock.docking.DockingStrategy; 27 | 28 | 29 | /** 30 | * @author Christopher Butler 31 | */ 32 | @SuppressWarnings(value = { "serial" }) 33 | public class DockingPortNode extends DockingNode { 34 | 35 | @Override 36 | public Object getDockingObject() { 37 | TreeNode parent = getParent(); 38 | if(!(parent instanceof SplitNode)) { 39 | return null; 40 | } 41 | 42 | TreeNode grandParent = parent.getParent(); 43 | if(!(grandParent instanceof DockingPortNode)) { 44 | return null; 45 | } 46 | 47 | DockingPort superPort = (DockingPort)((DefaultMutableTreeNode)grandParent).getUserObject(); 48 | DockingStrategy strategy = superPort.getDockingStrategy(); 49 | return strategy.createDockingPort(superPort); 50 | } 51 | 52 | public DockingPort getDockingPort() { 53 | return (DockingPort)getUserObject(); 54 | } 55 | 56 | public boolean isSplit() { 57 | int cnt = getChildCount(); 58 | if(cnt!=1) { 59 | return false; 60 | } 61 | 62 | return getChildAt(0) instanceof SplitNode; 63 | } 64 | 65 | @Override 66 | protected DockingNode shallowClone() { 67 | return new DockingPortNode(); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /flexdock-core/src/main/java/org/flexdock/event/Event.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.event; 21 | 22 | import java.util.EventObject; 23 | 24 | import org.flexdock.docking.DockingConstants; 25 | 26 | /** 27 | * @author Christopher Butler 28 | */ 29 | @SuppressWarnings(value = { "serial" }) 30 | public class Event extends EventObject implements DockingConstants { 31 | private int eventType; 32 | 33 | /** 34 | * An event object. 35 | * 36 | * @param src 37 | * the source of the event. 38 | * @param evtType 39 | * the type of the event. 40 | */ 41 | public Event(Object src, int evtType) { 42 | super(src); 43 | eventType = evtType; 44 | } 45 | 46 | public int getEventType() { 47 | return eventType; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /flexdock-core/src/main/java/org/flexdock/event/RegistrationEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.event; 21 | 22 | 23 | /** 24 | * @author Christopher Butler 25 | */ 26 | public class RegistrationEvent extends Event { 27 | public static final int REGISTERED = 0; 28 | public static final int UNREGISTERED = 1; 29 | 30 | private Object owner; 31 | 32 | public RegistrationEvent(Object src, Object owner, int evtType) { 33 | super(src, evtType); 34 | this.owner = owner; 35 | } 36 | 37 | public RegistrationEvent(Object src, Object owner, boolean registered) { 38 | this(src, owner, registered? REGISTERED: UNREGISTERED); 39 | } 40 | 41 | public Object getOwner() { 42 | return owner; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /flexdock-core/src/main/java/org/flexdock/event/RegistrationHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.event; 21 | 22 | import java.util.EventListener; 23 | 24 | 25 | /** 26 | * @author Christopher Butler 27 | */ 28 | public class RegistrationHandler extends EventHandler { 29 | 30 | @Override 31 | public boolean acceptsEvent(Event evt) { 32 | return evt instanceof RegistrationEvent; 33 | } 34 | 35 | @Override 36 | public boolean acceptsListener(EventListener listener) { 37 | return listener instanceof RegistrationListener; 38 | } 39 | 40 | @Override 41 | public void handleEvent(Event evt, EventListener listener, int eventType) { 42 | RegistrationEvent regEvt = (RegistrationEvent)evt; 43 | RegistrationListener regListener = (RegistrationListener)listener; 44 | 45 | switch(eventType) { 46 | case RegistrationEvent.REGISTERED: 47 | regListener.registered(regEvt); 48 | break; 49 | case RegistrationEvent.UNREGISTERED: 50 | regListener.unregistered(regEvt); 51 | break; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /flexdock-core/src/main/java/org/flexdock/event/RegistrationListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.event; 21 | 22 | 23 | /** 24 | * @author Christopher Butler 25 | */ 26 | public interface RegistrationListener { 27 | public void registered(RegistrationEvent evt); 28 | public void unregistered(RegistrationEvent evt); 29 | } 30 | -------------------------------------------------------------------------------- /flexdock-core/src/main/resources/org/flexdock/docking/defaults/downArrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-core/src/main/resources/org/flexdock/docking/defaults/downArrow.gif -------------------------------------------------------------------------------- /flexdock-core/src/main/resources/org/flexdock/docking/defaults/emptyIcon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-core/src/main/resources/org/flexdock/docking/defaults/emptyIcon.gif -------------------------------------------------------------------------------- /flexdock-core/src/main/resources/org/flexdock/docking/defaults/leftArrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-core/src/main/resources/org/flexdock/docking/defaults/leftArrow.gif -------------------------------------------------------------------------------- /flexdock-core/src/main/resources/org/flexdock/docking/defaults/notAllowed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-core/src/main/resources/org/flexdock/docking/defaults/notAllowed.gif -------------------------------------------------------------------------------- /flexdock-core/src/main/resources/org/flexdock/docking/defaults/rightArrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-core/src/main/resources/org/flexdock/docking/defaults/rightArrow.gif -------------------------------------------------------------------------------- /flexdock-core/src/main/resources/org/flexdock/docking/defaults/stacked.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-core/src/main/resources/org/flexdock/docking/defaults/stacked.gif -------------------------------------------------------------------------------- /flexdock-core/src/main/resources/org/flexdock/docking/defaults/upArrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-core/src/main/resources/org/flexdock/docking/defaults/upArrow.gif -------------------------------------------------------------------------------- /flexdock-core/src/main/resources/org/flexdock/docking/drag/effects/drag-effects.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /flexdock-core/src/main/resources/org/flexdock/docking/drag/outline/win32/RubberBand.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-core/src/main/resources/org/flexdock/docking/drag/outline/win32/RubberBand.dll -------------------------------------------------------------------------------- /flexdock-core/src/main/resources/org/flexdock/docking/drag/outline/xlib/libRubberBand.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-core/src/main/resources/org/flexdock/docking/drag/outline/xlib/libRubberBand.so -------------------------------------------------------------------------------- /flexdock-core/src/main/resources/org/flexdock/docking/flexdock-core.properties: -------------------------------------------------------------------------------- 1 | minimize.manager=org.flexdock.dockbar.MinimizationAdapter 2 | layout.manager=org.flexdock.perspective.PerspectiveManager 3 | 4 | flexdock.allow.divider.resize=true 5 | -------------------------------------------------------------------------------- /flexdock-core/src/main/resources/org/flexdock/util/dev-props.properties: -------------------------------------------------------------------------------- 1 | rubberband.debug=true 2 | -------------------------------------------------------------------------------- /flexdock-core/src/main/resources/org/flexdock/util/laf-defaults.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /flexdock-core/src/main/resources/org/flexdock/util/os-info.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /flexdock-demo/src/main/java/org/flexdock/demos/maximizing/DockableSimpleInternalFrame.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.demos.maximizing; 21 | 22 | import java.awt.Component; 23 | 24 | import org.flexdock.docking.DockingManager; 25 | import org.flexdock.docking.defaults.AbstractDockable; 26 | 27 | public class DockableSimpleInternalFrame extends AbstractDockable { 28 | private Component component; 29 | 30 | public DockableSimpleInternalFrame(SimpleInternalFrame sif) { 31 | this(sif, sif.getTitle()); 32 | } 33 | 34 | public DockableSimpleInternalFrame(SimpleInternalFrame sif, String id) { 35 | super(id); 36 | this.component = sif; 37 | getDragSources().add(sif.getDragHandle()); 38 | getFrameDragSources().add(sif.getDragHandle()); 39 | setTabText(sif.getTitle()); 40 | } 41 | 42 | @Override 43 | public Component getComponent() { 44 | return component; 45 | } 46 | 47 | public void dispose() { 48 | DockingManager.unregisterDockable(this); 49 | component = null; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /flexdock-demo/src/main/java/org/flexdock/demos/maximizing/MyDockingPort.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.demos.maximizing; 21 | 22 | import javax.swing.JTabbedPane; 23 | import javax.swing.border.Border; 24 | 25 | import org.flexdock.docking.DockingManager; 26 | import org.flexdock.docking.DockingPort; 27 | import org.flexdock.docking.defaults.DefaultDockingPort; 28 | import org.flexdock.docking.defaults.DefaultDockingStrategy; 29 | import org.flexdock.docking.defaults.StandardBorderManager; 30 | import org.flexdock.plaf.common.border.ShadowBorder; 31 | 32 | public class MyDockingPort extends DefaultDockingPort { 33 | 34 | static { 35 | initStatic(); 36 | } 37 | 38 | private static void initStatic() { 39 | DockingManager.setDockingStrategy(MyDockingPort.class, new MyDockingStrategy()); 40 | } 41 | 42 | public MyDockingPort() { 43 | this(new ShadowBorder()); 44 | } 45 | 46 | public MyDockingPort(Border portletBorder) { 47 | super(); 48 | if (portletBorder != null) { 49 | setBorderManager(new StandardBorderManager(portletBorder)); 50 | } 51 | } 52 | 53 | @Override 54 | protected JTabbedPane createTabbedPane() { 55 | JTabbedPane tabbed = super.createTabbedPane(); 56 | tabbed.putClientProperty("jgoodies.embeddedTabs", Boolean.TRUE); 57 | return tabbed; 58 | } 59 | 60 | // *************** 61 | 62 | private static class MyDockingStrategy extends DefaultDockingStrategy { 63 | @Override 64 | protected DockingPort createDockingPortImpl(DockingPort base) { 65 | return new MyDockingPort(); 66 | } 67 | 68 | 69 | } 70 | 71 | } -------------------------------------------------------------------------------- /flexdock-demo/src/main/java/org/flexdock/demos/raw/elegant/DockableImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.demos.raw.elegant; 21 | 22 | import java.awt.Component; 23 | 24 | import javax.swing.JComponent; 25 | 26 | import org.flexdock.docking.DockingManager; 27 | import org.flexdock.docking.defaults.AbstractDockable; 28 | 29 | public class DockableImpl extends AbstractDockable { 30 | private ElegantPanel panel; 31 | private JComponent dragInitiator; 32 | 33 | public DockableImpl(ElegantPanel dockable, JComponent dragInit, String id) { 34 | super(id); 35 | if(dockable==null) { 36 | new IllegalArgumentException( 37 | "Cannot create DockableImpl with a null DockablePanel."); 38 | } 39 | if(dragInit==null) { 40 | new IllegalArgumentException( 41 | "Cannot create DockableImpl with a null drag initiator."); 42 | } 43 | 44 | panel = dockable; 45 | dragInitiator = dragInit; 46 | setTabText(panel.getTitle()); 47 | getDragSources().add(dragInit); 48 | getFrameDragSources().add(dockable.getTitlebar()); 49 | DockingManager.registerDockable(this); 50 | } 51 | 52 | @Override 53 | public Component getComponent() { 54 | return panel; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /flexdock-demo/src/main/java/org/flexdock/demos/raw/elegant/ElegantPanel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.demos.raw.elegant; 21 | 22 | import javax.swing.JComponent; 23 | 24 | import org.flexdock.demos.util.DockingStubTitlepane; 25 | import org.flexdock.demos.util.GradientTitlebar; 26 | import org.flexdock.demos.util.Titlebar; 27 | import org.flexdock.docking.Dockable; 28 | import org.flexdock.docking.DockingManager; 29 | 30 | 31 | public class ElegantPanel extends DockingStubTitlepane { 32 | private Dockable dockable; 33 | 34 | public ElegantPanel(String title) { 35 | super(title, title); 36 | DockingManager.registerDockable(this); 37 | } 38 | 39 | public void dock(ElegantPanel otherPanel) { 40 | DockingManager.dock(otherPanel, this); 41 | } 42 | 43 | public void dock(ElegantPanel otherPanel, String region) { 44 | DockingManager.dock(otherPanel, this, region); 45 | } 46 | 47 | public void dock(ElegantPanel otherPanel, String region, float ratio) { 48 | DockingManager.dock(otherPanel, this, region, ratio); 49 | } 50 | 51 | @Override 52 | protected JComponent createContentPane() { 53 | return null; 54 | } 55 | 56 | @Override 57 | protected Titlebar createTitlebar(String title) { 58 | return new GradientTitlebar(title); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /flexdock-demo/src/main/java/org/flexdock/demos/util/DockingStubTitlepane.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.demos.util; 21 | 22 | import java.awt.Component; 23 | 24 | import org.flexdock.docking.DockingStub; 25 | 26 | /** 27 | * @author Christopher Butler 28 | */ 29 | public class DockingStubTitlepane extends Titlepane implements DockingStub { 30 | private String dockingId; 31 | 32 | public DockingStubTitlepane(String id, String title) { 33 | super(title); 34 | dockingId = id; 35 | } 36 | 37 | @Override 38 | public Component getDragSource() { 39 | return getTitlebar(); 40 | } 41 | 42 | @Override 43 | public Component getFrameDragSource() { 44 | return getTitlebar(); 45 | } 46 | 47 | @Override 48 | public String getPersistentId() { 49 | return dockingId; 50 | } 51 | 52 | @Override 53 | public String getTabText() { 54 | return getTitle(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /flexdock-demo/src/main/java/org/flexdock/demos/util/GradientPainter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.demos.util; 21 | 22 | import java.awt.Color; 23 | import java.awt.GradientPaint; 24 | import java.awt.Graphics; 25 | import java.awt.Graphics2D; 26 | 27 | import javax.swing.JComponent; 28 | 29 | /** 30 | * @author Christopher Butler 31 | */ 32 | public class GradientPainter { 33 | private Color startColor; 34 | private Color midColor; 35 | 36 | 37 | public GradientPainter(Color start, Color mid) { 38 | startColor = start; 39 | midColor = mid; 40 | } 41 | 42 | public void paintGradient(JComponent comp, Graphics g) { 43 | int h = comp.getHeight(); 44 | int w = comp.getWidth(); 45 | int mid = w/2; 46 | 47 | Color bgColor = comp.getBackground(); 48 | Color start = startColor==null? bgColor: startColor; 49 | Color middle = midColor==null? bgColor: midColor; 50 | 51 | GradientPaint firstHalf = new GradientPaint(0, 0, start, mid, 0, middle); 52 | GradientPaint secondHalf = new GradientPaint(mid, 0, middle, w, 0, bgColor); 53 | 54 | Graphics2D g2 = (Graphics2D)g; 55 | g2.setPaint(firstHalf); 56 | g2.fillRect(0, 0, mid, h); 57 | g2.setPaint(secondHalf); 58 | g2.fillRect(mid-1, 0, mid, h); 59 | } 60 | 61 | public Color getMidColor() { 62 | return midColor; 63 | } 64 | public void setMidColor(Color midColor) { 65 | this.midColor = midColor; 66 | } 67 | public Color getStartColor() { 68 | return startColor; 69 | } 70 | public void setStartColor(Color startColor) { 71 | this.startColor = startColor; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /flexdock-demo/src/main/java/org/flexdock/demos/util/GradientTitlebar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.demos.util; 21 | 22 | import java.awt.Color; 23 | import java.awt.Font; 24 | import java.awt.Graphics; 25 | 26 | /** 27 | * @author Christopher Butler 28 | */ 29 | public class GradientTitlebar extends Titlebar { 30 | public static final Color DEFAULT_MID_COLOR = new Color(168, 203, 239); 31 | public static final Color DEFAULT_START_COLOR = new Color(10, 36, 106); 32 | 33 | private GradientPainter gradient; 34 | 35 | public GradientTitlebar() { 36 | super(); 37 | init(null, null); 38 | } 39 | 40 | public GradientTitlebar(String text) { 41 | super(text); 42 | init(null, null); 43 | } 44 | 45 | public GradientTitlebar(String text, Color start, Color mid) { 46 | super(text); 47 | init(start, mid); 48 | } 49 | 50 | private void init(Color start, Color mid) { 51 | setOpaque(false); 52 | gradient = new GradientPainter(start, mid); 53 | setStartColor(start); 54 | setMidColor(mid); 55 | setForeground(Color.WHITE); 56 | setFont(getFont().deriveFont(Font.PLAIN)); 57 | } 58 | 59 | public void setStartColor(Color color) { 60 | gradient.setStartColor(color==null? DEFAULT_START_COLOR: color); 61 | } 62 | 63 | public void setMidColor(Color color) { 64 | gradient.setMidColor(color==null? DEFAULT_MID_COLOR: color); 65 | } 66 | 67 | @Override 68 | protected void paintComponent(Graphics g) { 69 | gradient.paintGradient(this, g); 70 | super.paintComponent(g); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /flexdock-demo/src/main/java/org/flexdock/demos/util/Titlebar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.demos.util; 21 | 22 | import java.awt.Color; 23 | import java.awt.Graphics; 24 | 25 | import javax.swing.JLabel; 26 | import javax.swing.border.EmptyBorder; 27 | 28 | /** 29 | * @author Christopher Butler 30 | */ 31 | public class Titlebar extends JLabel { 32 | 33 | public Titlebar() { 34 | super(); 35 | init(); 36 | } 37 | 38 | public Titlebar(String text) { 39 | super(text); 40 | init(); 41 | } 42 | 43 | public Titlebar(String text, Color bgColor) { 44 | super(text); 45 | init(); 46 | setBackground(bgColor); 47 | } 48 | 49 | private void init() { 50 | setOpaque(true); 51 | setBorder(new EmptyBorder(2, 4, 2, 2)); 52 | } 53 | 54 | @Override 55 | protected void paintBorder(Graphics g) { 56 | int w = getWidth(); 57 | int h = getHeight(); 58 | 59 | g.setColor(getBackground().brighter()); 60 | g.drawLine(0, 0, w, 0); 61 | g.drawLine(0, 0, 0, h); 62 | 63 | g.setColor(getBackground().darker()); 64 | g.drawLine(0, h, w, h); 65 | } 66 | 67 | public void setTitle(String title) { 68 | if(title==null) { 69 | title = ""; 70 | } 71 | title = title.trim(); 72 | setText(title); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /flexdock-demo/src/main/java/org/flexdock/demos/util/Titlepane.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.demos.util; 21 | 22 | import java.awt.BorderLayout; 23 | import java.awt.Color; 24 | 25 | import javax.swing.JComponent; 26 | import javax.swing.JLabel; 27 | import javax.swing.JPanel; 28 | import javax.swing.border.LineBorder; 29 | 30 | /** 31 | * @author Christopher Butler 32 | */ 33 | public class Titlepane extends JPanel { 34 | private Titlebar titlebar; 35 | private JComponent contentPane; 36 | 37 | public Titlepane(String title) { 38 | setLayout(new BorderLayout()); 39 | 40 | titlebar = createTitlebar(title); 41 | add(titlebar, BorderLayout.NORTH); 42 | setContentPane(createContentPane()); 43 | } 44 | 45 | public String getTitle() { 46 | return titlebar.getText(); 47 | } 48 | 49 | public void setTitle(String title) { 50 | titlebar.setTitle(title); 51 | } 52 | 53 | public JLabel getTitlebar() { 54 | return titlebar; 55 | } 56 | 57 | protected Titlebar createTitlebar(String title) { 58 | return new Titlebar(title, new Color(183, 201, 217)); 59 | } 60 | 61 | public void setContentPane(JComponent comp) { 62 | if(contentPane!=null) { 63 | remove(contentPane); 64 | } 65 | if(comp!=null) { 66 | add(comp, BorderLayout.CENTER); 67 | } 68 | contentPane = comp; 69 | } 70 | 71 | protected JComponent createContentPane() { 72 | JPanel pane = new JPanel(); 73 | pane.setBorder(new LineBorder(Color.DARK_GRAY)); 74 | pane.setBackground(Color.WHITE); 75 | return pane; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /flexdock-demo/src/main/resources/aquathemepack.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-demo/src/main/resources/aquathemepack.zip -------------------------------------------------------------------------------- /flexdock-demo/src/main/resources/fish.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-demo/src/main/resources/fish.mov -------------------------------------------------------------------------------- /flexdock-demo/src/main/resources/lung02a.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-demo/src/main/resources/lung02a.mov -------------------------------------------------------------------------------- /flexdock-demo/src/main/resources/org/flexdock/demos/maximizing/maximize.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-demo/src/main/resources/org/flexdock/demos/maximizing/maximize.gif -------------------------------------------------------------------------------- /flexdock-demo/src/main/resources/org/flexdock/demos/raw/adapter/docking-adapter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flexdock-demo/src/main/resources/org/flexdock/demos/view/birdView001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-demo/src/main/resources/org/flexdock/demos/view/birdView001.png -------------------------------------------------------------------------------- /flexdock-demo/src/main/resources/org/flexdock/demos/view/console001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-demo/src/main/resources/org/flexdock/demos/view/console001.png -------------------------------------------------------------------------------- /flexdock-demo/src/main/resources/org/flexdock/demos/view/ms_misc_icons001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-demo/src/main/resources/org/flexdock/demos/view/ms_misc_icons001.png -------------------------------------------------------------------------------- /flexdock-demo/src/main/resources/org/flexdock/demos/view/ms_tabs001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-demo/src/main/resources/org/flexdock/demos/view/ms_tabs001.png -------------------------------------------------------------------------------- /flexdock-demo/src/main/resources/org/flexdock/demos/view/msgLog001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-demo/src/main/resources/org/flexdock/demos/view/msgLog001.png -------------------------------------------------------------------------------- /flexdock-demo/src/main/resources/org/flexdock/demos/view/problems001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-demo/src/main/resources/org/flexdock/demos/view/problems001.png -------------------------------------------------------------------------------- /flexdock-demo/src/main/resources/org/flexdock/demos/view/titlebar/msvs001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-demo/src/main/resources/org/flexdock/demos/view/titlebar/msvs001.png -------------------------------------------------------------------------------- /flexdock-demo/src/main/resources/quickSilverRthemepack.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-demo/src/main/resources/quickSilverRthemepack.zip -------------------------------------------------------------------------------- /flexdock-demo/src/main/resources/themepack.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-demo/src/main/resources/themepack.zip -------------------------------------------------------------------------------- /flexdock-drag/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | org.flexdock 6 | flexdock 7 | 1.3 8 | 9 | flexdock-drag 10 | 1.3 11 | jar 12 | 13 | ${project.artifactId} 14 | ${project.name} 15 | 16 | 17 | 18 | org.flexdock 19 | flexdock-core 20 | 1.3 21 | jar 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /flexdock-perspective/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | org.flexdock 6 | flexdock 7 | 1.3 8 | 9 | flexdock-perspective 10 | 1.3 11 | jar 12 | 13 | ${project.artifactId} 14 | ${project.name} 15 | 16 | 17 | 18 | org.flexdock 19 | flexdock-core 20 | 1.3 21 | jar 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/PerspectiveFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.perspective; 21 | 22 | /** 23 | * @author Christopher Butler 24 | */ 25 | public interface PerspectiveFactory { 26 | 27 | Perspective getPerspective(String persistentId); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/actions/OpenPerspectiveAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.perspective.actions; 21 | 22 | import java.awt.event.ActionEvent; 23 | 24 | import javax.swing.AbstractAction; 25 | import javax.swing.Action; 26 | 27 | import org.flexdock.perspective.Perspective; 28 | import org.flexdock.perspective.PerspectiveManager; 29 | 30 | /** 31 | * @author Christopher Butler 32 | */ 33 | public class OpenPerspectiveAction extends AbstractAction { 34 | private String perspective; 35 | 36 | public OpenPerspectiveAction(String perspectiveId) { 37 | if (perspectiveId == null) { 38 | throw new IllegalArgumentException("perspectiveId cannot be null"); 39 | } 40 | this.perspective = perspectiveId; 41 | 42 | Perspective perspective = getPerspective(); 43 | if(perspective!=null) { 44 | putValue(Action.NAME, perspective.getName()); 45 | } 46 | } 47 | 48 | public Perspective getPerspective() { 49 | return PerspectiveManager.getInstance().getPerspective(this.perspective); 50 | } 51 | 52 | @Override 53 | public void actionPerformed(ActionEvent e) { 54 | if (this.perspective != null) { 55 | PerspectiveManager.getInstance().loadPerspective(this.perspective); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/event/LayoutEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.perspective.event; 21 | 22 | import org.flexdock.docking.Dockable; 23 | import org.flexdock.docking.DockingManager; 24 | import org.flexdock.event.Event; 25 | import org.flexdock.perspective.Layout; 26 | 27 | /** 28 | * @author Christopher Butler 29 | */ 30 | public class LayoutEvent extends Event { 31 | public static final int LAYOUT_APPLIED = 0; 32 | public static final int LAYOUT_EMPTIED = 1; 33 | public static final int DOCKABLE_HIDDEN = 2; 34 | public static final int DOCKABLE_RESTORED = 3; 35 | 36 | private Layout oldLayout; 37 | private Dockable dockable; 38 | 39 | public LayoutEvent(Layout layout, Layout oldLayout, String dockableId, int evtType) { 40 | super(layout, evtType); 41 | this.oldLayout = oldLayout; 42 | dockable = DockingManager.getDockable(dockableId); 43 | } 44 | 45 | public Layout getOldLayout() { 46 | return oldLayout; 47 | } 48 | 49 | public Dockable getDockable() { 50 | return dockable; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/event/LayoutEventHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.perspective.event; 21 | 22 | import java.util.EventListener; 23 | 24 | import org.flexdock.event.Event; 25 | import org.flexdock.event.EventHandler; 26 | import org.flexdock.perspective.Layout; 27 | 28 | /** 29 | * @author Christopher Butler 30 | */ 31 | public class LayoutEventHandler extends EventHandler { 32 | 33 | @Override 34 | public boolean acceptsEvent(Event evt) { 35 | return evt instanceof LayoutEvent; 36 | } 37 | @Override 38 | public boolean acceptsListener(EventListener listener) { 39 | return listener instanceof LayoutListener; 40 | } 41 | 42 | @Override 43 | public void handleEvent(Event evt, EventListener listener, int eventType) { 44 | LayoutEvent event = (LayoutEvent)evt; 45 | LayoutListener consumer = (LayoutListener)listener; 46 | 47 | switch(eventType) { 48 | case LayoutEvent.DOCKABLE_HIDDEN: 49 | consumer.dockableHidden(event); 50 | break; 51 | case LayoutEvent.DOCKABLE_RESTORED: 52 | consumer.dockableDisplayed(event); 53 | break; 54 | case LayoutEvent.LAYOUT_APPLIED: 55 | consumer.layoutApplied(event); 56 | break; 57 | case LayoutEvent.LAYOUT_EMPTIED: 58 | consumer.layoutEmptied(event); 59 | break; 60 | } 61 | } 62 | 63 | @Override 64 | public EventListener[] getListeners(Object eventTarget) { 65 | return eventTarget instanceof Layout? 66 | ((Layout)eventTarget).getListeners(): null; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/event/LayoutListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.perspective.event; 21 | 22 | import java.util.EventListener; 23 | 24 | /** 25 | * @author Christopher Butler 26 | */ 27 | public interface LayoutListener extends EventListener { 28 | public void layoutApplied(LayoutEvent evt); 29 | public void layoutEmptied(LayoutEvent evt); 30 | public void dockableHidden(LayoutEvent evt); 31 | public void dockableDisplayed(LayoutEvent evt); 32 | } 33 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/event/PerspectiveEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.perspective.event; 21 | 22 | import org.flexdock.event.Event; 23 | import org.flexdock.perspective.Perspective; 24 | 25 | /** 26 | * 27 | * @author Mateusz Szczap 28 | */ 29 | public class PerspectiveEvent extends Event { 30 | public final static int CHANGED = 1; 31 | public final static int RESET = 2; 32 | 33 | private Perspective oldPerspective; 34 | 35 | public PerspectiveEvent(Perspective perspective, Perspective oldPerspective, int eventType) { 36 | super(perspective, eventType); 37 | this.oldPerspective = oldPerspective; 38 | } 39 | 40 | public Perspective getPerspective() { 41 | return (Perspective)getSource(); 42 | } 43 | 44 | public Perspective getOldPerspective() { 45 | return oldPerspective; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/event/PerspectiveListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.perspective.event; 21 | 22 | import java.util.EventListener; 23 | 24 | /** 25 | * @author mateusz 26 | */ 27 | public interface PerspectiveListener extends EventListener { 28 | 29 | void perspectiveChanged(PerspectiveEvent evt); 30 | 31 | void perspectiveReset(PerspectiveEvent evt); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/event/RegistrationEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.perspective.event; 21 | 22 | /** 23 | * @author Christopher Butler 24 | */ 25 | public class RegistrationEvent extends org.flexdock.event.RegistrationEvent { 26 | 27 | public RegistrationEvent(Object src, Object owner, boolean registered) { 28 | super(src, owner, registered); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/event/RegistrationListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.perspective.event; 21 | 22 | /** 23 | * @author Christopher Butler 24 | */ 25 | public interface RegistrationListener extends org.flexdock.event.RegistrationListener { 26 | public void perspectiveAdded(RegistrationEvent evt); 27 | public void dockableAdded(RegistrationEvent evt); 28 | 29 | public void perspectiveRemoved(RegistrationEvent evt); 30 | public void dockableRemoved(RegistrationEvent evt); 31 | } 32 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/persist/PersistenceHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 FlexDock Development Team. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, 7 | * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 8 | * to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 14 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 15 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 16 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 17 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE. 18 | */ 19 | package org.flexdock.perspective.persist; 20 | 21 | import java.io.IOException; 22 | 23 | import org.flexdock.docking.state.PersistenceException; 24 | 25 | /** 26 | * Created on 2005-06-03 27 | * 28 | * @author Mateusz Szczap 29 | * @version $Id: PersistenceHandler.java,v 1.5 2005-07-06 03:21:53 marius Exp $ 30 | */ 31 | public interface PersistenceHandler { 32 | 33 | boolean store(String persistenceKey, PerspectiveModel perspectiveModel) throws IOException, PersistenceException; 34 | 35 | PerspectiveModel load(String persistenceKey) throws IOException, PersistenceException; 36 | 37 | Persister createDefaultPersister(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/persist/Persister.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 FlexDock Development Team. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, 7 | * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 8 | * to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 14 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 15 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 16 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 17 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE. 18 | */ 19 | package org.flexdock.perspective.persist; 20 | 21 | import java.io.IOException; 22 | import java.io.InputStream; 23 | import java.io.OutputStream; 24 | 25 | import org.flexdock.docking.state.PersistenceException; 26 | 27 | /** 28 | * Created on 2005-03-30 29 | * 30 | * @author Christopher Butler 31 | * @author Mateusz Szczap 32 | * @version $Id: Persister.java,v 1.7 2005-07-05 14:53:26 marius Exp $ 33 | */ 34 | public interface Persister { 35 | 36 | /** 37 | * Serializes PerspectiveInfo to the supplied data stream. 38 | * 39 | * @param os OutputStream to persist perspectiveInfo to. 40 | * @param perspectiveInfo data object to be persisted 41 | * @return true when there was no problem with persisting the perspectiveInfo object. 42 | * @throws IOException in case of input/output problem. 43 | */ 44 | boolean store(OutputStream os, PerspectiveModel perspectiveInfo) throws IOException, PersistenceException; 45 | 46 | /** 47 | * Deserializes PerspectiveInfo from the supplied data stream. 48 | * 49 | * @param is InputStream to load perspectiveInfo from. 50 | * @return true when there was no problem with persisting the perspectiveInfo object. 51 | * @throws IOException in case of input/output problem. 52 | */ 53 | PerspectiveModel load(InputStream is) throws IOException, PersistenceException; 54 | 55 | } 56 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/persist/PerspectiveModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 FlexDock Development Team. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, 7 | * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 8 | * to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 14 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 15 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 16 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 17 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE. 18 | */ 19 | package org.flexdock.perspective.persist; 20 | 21 | import java.io.Serializable; 22 | 23 | import org.flexdock.perspective.Perspective; 24 | 25 | /** 26 | * Created on 2005-03-30 27 | * 28 | * @author Christopher Butler 29 | * @author Mateusz Szczap 30 | * @version $Id: PerspectiveModel.java,v 1.1 2005-06-11 16:14:48 marius Exp $ 31 | */ 32 | public class PerspectiveModel implements Serializable { 33 | 34 | private String defaultPerspective; 35 | private String currentPerspective; 36 | private Perspective[] perspectives; 37 | 38 | public PerspectiveModel(String defaultId, String current, Perspective[] perspectives) { 39 | this.defaultPerspective = defaultId; 40 | this.currentPerspective = current; 41 | this.perspectives = perspectives; 42 | } 43 | 44 | public String getDefaultPerspective() { 45 | return this.defaultPerspective; 46 | } 47 | 48 | public void setDefaultPerspective(String defaultPerspective) { 49 | this.defaultPerspective = defaultPerspective; 50 | } 51 | 52 | public Perspective[] getPerspectives() { 53 | return this.perspectives; 54 | } 55 | 56 | public void setPerspectives(Perspective[] perspectives) { 57 | this.perspectives = perspectives; 58 | } 59 | 60 | public String getCurrentPerspective() { 61 | return this.currentPerspective; 62 | } 63 | 64 | public void setCurrentPerspective(String currentPerspective) { 65 | this.currentPerspective = currentPerspective; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/persist/xml/DimensionSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 FlexDock Development Team. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, 7 | * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 8 | * to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 14 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 15 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 16 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 17 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE. 18 | */ 19 | package org.flexdock.perspective.persist.xml; 20 | 21 | import java.awt.Dimension; 22 | 23 | import org.w3c.dom.Document; 24 | import org.w3c.dom.Element; 25 | 26 | /** 27 | * Created on 2005-06-03 28 | * 29 | * @author Mateusz Szczap 30 | * @version $Id: DimensionSerializer.java,v 1.7 2005-07-07 22:24:01 winnetou25 Exp $ 31 | */ 32 | public class DimensionSerializer implements ISerializer { 33 | 34 | /** 35 | * @see org.flexdock.perspective.persist.xml.ISerializer#serialize(org.w3c.dom.Document, java.lang.Object) 36 | */ 37 | @Override 38 | public Element serialize(Document document, Object object) { 39 | Dimension dimension = (Dimension) object; 40 | 41 | Element dimensionElement = document.createElement(PersistenceConstants.DIMENSION_ELEMENT_NAME); 42 | 43 | dimensionElement.setAttribute(PersistenceConstants.DIMENSION_ATTRIBUTE_HEIGHT, String.valueOf(dimension.height)); 44 | dimensionElement.setAttribute(PersistenceConstants.DIMENSION_ATTRIBUTE_WIDTH, String.valueOf(dimension.width)); 45 | 46 | return dimensionElement; 47 | } 48 | 49 | @Override 50 | public Object deserialize(Element element) { 51 | String width = element.getAttribute(PersistenceConstants.DIMENSION_ATTRIBUTE_WIDTH); 52 | String height = element.getAttribute(PersistenceConstants.DIMENSION_ATTRIBUTE_HEIGHT); 53 | 54 | return new Dimension(Integer.parseInt(width), Integer.parseInt(height)); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/persist/xml/DockableNodeSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 FlexDock Development Team. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, 7 | * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 8 | * to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 14 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 15 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 16 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 17 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE. 18 | */ 19 | package org.flexdock.perspective.persist.xml; 20 | 21 | import org.flexdock.docking.state.tree.DockableNode; 22 | import org.w3c.dom.Document; 23 | import org.w3c.dom.Element; 24 | 25 | /** 26 | * Created on 2005-06-27 27 | * 28 | * @author Mateusz Szczap 29 | * @version $Id: DockableNodeSerializer.java,v 1.7 2005-07-06 18:10:49 winnetou25 Exp $ 30 | */ 31 | public class DockableNodeSerializer implements ISerializer { 32 | 33 | @Override 34 | public Element serialize(Document document, Object object) { 35 | DockableNode dockableNode = (DockableNode) object; 36 | 37 | Element dockableNodeElement = document.createElement(PersistenceConstants.DOCKABLE_NODE_ELEMENT_NAME); 38 | dockableNodeElement.setAttribute(PersistenceConstants.DOCKABLE_NODE_ATTRIBUTE_DOCKABLE_ID, dockableNode.getDockableId()); 39 | 40 | return dockableNodeElement; 41 | } 42 | 43 | @Override 44 | public Object deserialize(Element element) { 45 | String dockableId = element.getAttribute(PersistenceConstants.DOCKABLE_NODE_ATTRIBUTE_DOCKABLE_ID); 46 | 47 | DockableNode dockableNode = new DockableNode(); 48 | dockableNode.setDockableId(dockableId); 49 | 50 | return dockableNode; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/persist/xml/DockingPortNodeSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 FlexDock Development Team. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, 7 | * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 8 | * to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 14 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 15 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 16 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 17 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE. 18 | */ 19 | package org.flexdock.perspective.persist.xml; 20 | 21 | import org.flexdock.docking.state.LayoutNode; 22 | import org.flexdock.docking.state.tree.DockingPortNode; 23 | import org.w3c.dom.Document; 24 | import org.w3c.dom.Element; 25 | 26 | /** 27 | * Created on 2005-06-27 28 | * 29 | * @author Mateusz Szczap 30 | * @version $Id: DockingPortNodeSerializer.java,v 1.5 2005-07-06 18:10:49 winnetou25 Exp $ 31 | */ 32 | public class DockingPortNodeSerializer extends AbstractLayoutNodeSerializer implements ISerializer { 33 | 34 | @Override 35 | public Element serialize(Document document, Object object) { 36 | DockingPortNode dockingPortNode = (DockingPortNode) object; 37 | Element dockingPortNodeElement = super.serialize(document, dockingPortNode); 38 | 39 | return dockingPortNodeElement; 40 | } 41 | 42 | @Override 43 | protected Element getElement(Document document, Object o) { 44 | return document.createElement(PersistenceConstants.DOCKING_PORT_NODE_ELEMENT_NAME); 45 | } 46 | 47 | @Override 48 | public Object deserialize(Element element) { 49 | return super.deserialize(element); 50 | } 51 | 52 | @Override 53 | protected LayoutNode createLayoutNode() { 54 | return new DockingPortNode(); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/persist/xml/ISerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 FlexDock Development Team. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, 7 | * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 8 | * to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 14 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 15 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 16 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 17 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE. 18 | */ 19 | package org.flexdock.perspective.persist.xml; 20 | 21 | import org.w3c.dom.Document; 22 | import org.w3c.dom.Element; 23 | 24 | /** 25 | * Created on 2005-06-03 26 | * 27 | * @author Mateusz Szczap 28 | * @version $Id: ISerializer.java,v 1.5 2005-07-06 18:10:48 winnetou25 Exp $ 29 | */ 30 | public interface ISerializer { 31 | 32 | Element serialize(Document document, Object object); 33 | 34 | Object deserialize(Element element); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/persist/xml/PointSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 FlexDock Development Team. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, 7 | * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 8 | * to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 14 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 15 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 16 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 17 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE. 18 | */ 19 | package org.flexdock.perspective.persist.xml; 20 | 21 | import java.awt.Point; 22 | 23 | import org.w3c.dom.Document; 24 | import org.w3c.dom.Element; 25 | 26 | /** 27 | * Created on 2005-06-03 28 | * 29 | * @author Mateusz Szczap 30 | * @version $Id: PointSerializer.java,v 1.8 2005-07-06 18:10:47 winnetou25 Exp $ 31 | */ 32 | public class PointSerializer implements ISerializer { 33 | 34 | // private String m_tagName = null; 35 | // 36 | // public PointSerializer(String tagName) { 37 | // if (tagName == null) throw new IllegalArgumentException("tagName cannot be null"); 38 | // m_tagName = tagName; 39 | // } 40 | 41 | /** 42 | * @see org.flexdock.perspective.persist.xml.ISerializer#serialize(org.w3c.dom.Document, java.lang.Object) 43 | */ 44 | @Override 45 | public Element serialize(Document document, Object object) { 46 | Point point = (Point) object; 47 | 48 | Element pointElement = document.createElement(PersistenceConstants.POINT_ELEMENT_NAME); 49 | pointElement.setAttribute(PersistenceConstants.POINT_ATTRIBUTE_X, String.valueOf(point.x)); 50 | pointElement.setAttribute(PersistenceConstants.POINT_ATTRIBUTE_Y, String.valueOf(point.y)); 51 | 52 | return pointElement; 53 | } 54 | 55 | @Override 56 | public Object deserialize(Element element) { 57 | String xString = element.getAttribute(PersistenceConstants.POINT_ATTRIBUTE_X); 58 | String yString = element.getAttribute(PersistenceConstants.POINT_ATTRIBUTE_Y); 59 | 60 | return new Point(Integer.parseInt(xString), Integer.parseInt(yString)); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/persist/xml/SerializerRegistry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 FlexDock Development Team. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, 7 | * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 8 | * to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 14 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 15 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 16 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 17 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE. 18 | */ 19 | package org.flexdock.perspective.persist.xml; 20 | 21 | import java.util.HashMap; 22 | 23 | /** 24 | * Created on 2005-06-03 25 | * 26 | * @author Mateusz Szczap 27 | * @version $Id: SerializerRegistry.java,v 1.5 2005-07-05 14:53:29 marius Exp $ 28 | */ 29 | public class SerializerRegistry { 30 | 31 | private static HashMap serializers = new HashMap(); 32 | 33 | public static void registerSerializer(Class clazz, ISerializer serializer) { 34 | if (clazz == null) { 35 | throw new IllegalArgumentException("clazz cannot be null"); 36 | } 37 | if (serializer == null) { 38 | throw new IllegalArgumentException("serializer cannot be null"); 39 | } 40 | 41 | serializers.put(clazz, serializer); 42 | } 43 | 44 | public static ISerializer getSerializer(Class clazz) { 45 | if (clazz == null) { 46 | throw new IllegalArgumentException("clazz cannot be null"); 47 | } 48 | 49 | return (ISerializer) serializers.get(clazz); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/restore/handlers/AlreadyRestoredHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 FlexDock Development Team. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, 7 | * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 8 | * to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 14 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 15 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 16 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 17 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE. 18 | */ 19 | package org.flexdock.perspective.restore.handlers; 20 | 21 | import java.util.Map; 22 | 23 | import org.flexdock.docking.Dockable; 24 | import org.flexdock.docking.DockingManager; 25 | import org.flexdock.docking.activation.ActiveDockableTracker; 26 | import org.flexdock.docking.state.DockingState; 27 | import org.flexdock.util.SwingUtility; 28 | 29 | /** 30 | * Created on 2005-04-15 31 | * 32 | * @author Mateusz Szczap 33 | * @author Christopher Butler 34 | * @version $Id: AlreadyRestoredHandler.java,v 1.4 2005-08-15 02:23:29 marius Exp $ 35 | */ 36 | public class AlreadyRestoredHandler implements RestorationHandler { 37 | 38 | @Override 39 | public boolean restore(Dockable dockable, DockingState info, Map context) { 40 | if (!DockingManager.isDocked(dockable)) { 41 | return false; 42 | } 43 | 44 | ActiveDockableTracker.requestDockableActivation(dockable.getComponent()); 45 | SwingUtility.focus(dockable.getComponent()); 46 | 47 | return true; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/restore/handlers/DockPathHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 FlexDock Development Team. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, 7 | * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 8 | * to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 14 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 15 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 16 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 17 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE. 18 | */ 19 | package org.flexdock.perspective.restore.handlers; 20 | 21 | import java.util.Map; 22 | 23 | import org.flexdock.docking.Dockable; 24 | import org.flexdock.docking.state.DockingPath; 25 | import org.flexdock.docking.state.DockingState; 26 | 27 | /** 28 | * Created on 2005-04-15 29 | * 30 | * @author Mateusz Szczap 31 | * @author Christopher Butler 32 | * @version $Id: DockPathHandler.java,v 1.2 2005-06-04 16:42:21 winnetou25 Exp $ 33 | */ 34 | public class DockPathHandler implements RestorationHandler { 35 | 36 | @Override 37 | public boolean restore(Dockable dockable, DockingState dockingState, Map context) { 38 | DockingPath dockingPath = dockingState.getPath(); 39 | if (dockingPath == null) { 40 | return false; 41 | } 42 | 43 | return dockingPath.restore(dockable); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/restore/handlers/FloatingHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 FlexDock Development Team. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, 7 | * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 8 | * to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 14 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 15 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 16 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 17 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE. 18 | */ 19 | package org.flexdock.perspective.restore.handlers; 20 | 21 | import java.awt.Component; 22 | import java.util.Map; 23 | 24 | import org.flexdock.docking.Dockable; 25 | import org.flexdock.docking.DockingManager; 26 | import org.flexdock.docking.floating.frames.DockingFrame; 27 | import org.flexdock.docking.state.DockingState; 28 | import org.flexdock.perspective.RestorationManager; 29 | 30 | /** 31 | * Created on 2005-04-15 32 | * 33 | * @author Mateusz Szczap 34 | * @author Christopher Butler 35 | * @version $Id: FloatingHandler.java,v 1.2 2005-06-04 16:42:22 winnetou25 Exp $ 36 | */ 37 | public class FloatingHandler implements RestorationHandler { 38 | 39 | @Override 40 | public boolean restore(Dockable dockable, DockingState dockingState, Map context) { 41 | if(dockingState == null || !dockingState.isFloating()) { 42 | return false; 43 | } 44 | 45 | Component owner = RestorationManager.getRestoreContainer(dockable); 46 | if(owner == null) { 47 | return false; 48 | } 49 | 50 | DockingFrame frame = DockingManager.getFloatManager().floatDockable(dockable, owner); 51 | return (frame != null); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/restore/handlers/MinimizedHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 FlexDock Development Team. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, 7 | * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 8 | * to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 14 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 15 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 16 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 17 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE. 18 | */ 19 | package org.flexdock.perspective.restore.handlers; 20 | 21 | import java.util.Map; 22 | 23 | import org.flexdock.docking.Dockable; 24 | import org.flexdock.docking.DockingManager; 25 | import org.flexdock.docking.state.DockingState; 26 | import org.flexdock.util.DockingUtility; 27 | 28 | /** 29 | * Created on 2005-05-12 30 | * 31 | * @author Mateusz Szczap 32 | * @author Christopher Butler 33 | * @version $Id: MinimizedHandler.java,v 1.3 2005-06-11 16:14:51 marius Exp $ 34 | */ 35 | public class MinimizedHandler implements RestorationHandler { 36 | 37 | @Override 38 | public boolean restore(Dockable dockable, DockingState dockingState, Map context) { 39 | if(dockingState == null || !dockingState.isMinimized()) { 40 | return false; 41 | } 42 | 43 | DockingManager.getMinimizeManager().preview(dockable, true); 44 | DockingManager.setMinimized(dockable, true, dockingState.getMinimizedConstraint()); 45 | 46 | return DockingUtility.isMinimized(dockable); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /flexdock-perspective/src/main/java/org/flexdock/perspective/restore/handlers/RestorationHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 FlexDock Development Team. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, 7 | * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 8 | * to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 14 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 15 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 16 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 17 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE. 18 | */ 19 | package org.flexdock.perspective.restore.handlers; 20 | 21 | import java.util.Map; 22 | 23 | import org.flexdock.docking.Dockable; 24 | import org.flexdock.docking.state.DockingState; 25 | 26 | /** 27 | * Created on 2005-04-15 28 | * 29 | * @author Mateusz Szczap 30 | * @author Christopher Butler 31 | * @version $Id: RestorationHandler.java,v 1.4 2006-12-20 17:34:56 kschaefe Exp $ 32 | */ 33 | public interface RestorationHandler { 34 | 35 | //TODO context is never used; remove? 36 | boolean restore(Dockable dockable, DockingState dockingState, Map context); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /flexdock-view/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | org.flexdock 6 | flexdock 7 | 1.3 8 | 9 | flexdock-view 10 | 1.3 11 | jar 12 | 13 | ${project.artifactId} 14 | ${project.name} 15 | 16 | 17 | 18 | org.flexdock 19 | flexdock-core 20 | 1.3 21 | jar 22 | 23 | 24 | org.flexdock 25 | flexdock-perspective 26 | 1.3 27 | jar 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/dockbar/MinimizationAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.dockbar; 21 | 22 | import java.awt.Component; 23 | 24 | import org.flexdock.docking.Dockable; 25 | import org.flexdock.docking.state.MinimizationManager; 26 | 27 | /** 28 | * @author Christopher Butler 29 | */ 30 | public class MinimizationAdapter implements MinimizationManager { 31 | 32 | static { 33 | init(); 34 | } 35 | 36 | private static void init() { 37 | // make sure DockbarManager is initialized 38 | Class c = DockbarManager.class; 39 | } 40 | 41 | @Override 42 | public boolean close(Dockable dockable) { 43 | DockbarManager mgr = DockbarManager.getCurrent(dockable); 44 | return mgr==null? false: mgr.remove(dockable); 45 | } 46 | 47 | @Override 48 | public void preview(Dockable dockable, boolean locked) { 49 | DockbarManager.activate(dockable, true); 50 | } 51 | 52 | @Override 53 | public void setMinimized(Dockable dockable, boolean minimizing, Component window, int edge) { 54 | DockbarManager mgr = DockbarManager.getInstance(window); 55 | if(mgr==null) { 56 | return; 57 | } 58 | 59 | if(minimizing) { 60 | // if minimizing, send to the dockbar 61 | if(edge==MinimizationManager.UNSPECIFIED_LAYOUT_CONSTRAINT) { 62 | mgr.minimize(dockable); 63 | } else { 64 | mgr.minimize(dockable, edge); 65 | } 66 | } else { 67 | // otherwise, restore from the dockbar 68 | mgr.restore(dockable); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/dockbar/activation/ActivationQueue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.dockbar.activation; 21 | 22 | import org.flexdock.dockbar.DockbarManager; 23 | 24 | 25 | 26 | /** 27 | * @author Christopher Butler 28 | */ 29 | public class ActivationQueue extends Thread { 30 | private DockbarManager manager; 31 | private Animation deactivation; 32 | private Runnable postDeactivate; 33 | private Animation activation; 34 | private Runnable postActivate; 35 | 36 | public ActivationQueue(DockbarManager mgr, Animation deactivation, Runnable r1, Animation activation, Runnable r2) { 37 | manager = mgr; 38 | this.deactivation = deactivation; 39 | this.postDeactivate = r1; 40 | this.activation = activation; 41 | this.postActivate = r2; 42 | } 43 | 44 | 45 | @Override 46 | public void run() { 47 | manager.setAnimating(true); 48 | if(deactivation!=null) { 49 | deactivation.run(); 50 | } 51 | postDeactivate.run(); 52 | if(activation!=null) { 53 | activation.run(); 54 | } 55 | postActivate.run(); 56 | manager.setAnimating(false); 57 | } 58 | 59 | 60 | 61 | } 62 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/dockbar/activation/ActiveDockableHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.dockbar.activation; 21 | 22 | import org.flexdock.dockbar.event.DockbarEvent; 23 | import org.flexdock.dockbar.event.DockbarListener; 24 | import org.flexdock.docking.Dockable; 25 | import org.flexdock.docking.activation.ActiveDockableTracker; 26 | import org.flexdock.util.DockingUtility; 27 | 28 | /** 29 | * @author Christopher Butler 30 | * 31 | * TODO To change the template for this generated type comment go to 32 | * Window - Preferences - Java - Code Style - Code Templates 33 | */ 34 | public class ActiveDockableHandler extends DockbarListener.Stub { 35 | 36 | @Override 37 | public void dockableLocked(DockbarEvent evt) { 38 | Dockable d = (Dockable)evt.getSource(); 39 | if(d!=null) { 40 | ActiveDockableTracker.requestDockableActivation(d.getComponent()); 41 | } 42 | } 43 | 44 | @Override 45 | public void minimizeStarted(DockbarEvent evt) { 46 | Dockable d = (Dockable)evt.getSource(); 47 | // block minimization on floating views 48 | if(d!=null && DockingUtility.isFloating(d)) { 49 | evt.consume(); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/dockbar/event/DockbarEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.dockbar.event; 21 | 22 | import org.flexdock.docking.Dockable; 23 | import org.flexdock.event.Event; 24 | 25 | /** 26 | * @author Christopher Butler 27 | */ 28 | public class DockbarEvent extends Event { 29 | public static final int EXPANDED = 0; 30 | public static final int LOCKED = 1; 31 | public static final int COLLAPSED = 2; 32 | 33 | public static final int MINIMIZE_STARTED = 10; 34 | public static final int MINIMIZE_COMPLETED = 11; 35 | 36 | private int edge; 37 | private boolean consumed; 38 | 39 | public DockbarEvent(Dockable dockable, int type, int edge) { 40 | super(dockable, type); 41 | this.edge = edge; 42 | } 43 | 44 | public int getEdge() { 45 | return edge; 46 | } 47 | 48 | public boolean isConsumed() { 49 | return consumed; 50 | } 51 | 52 | public void consume() { 53 | consumed = true; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/dockbar/event/DockbarListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.dockbar.event; 21 | 22 | import java.util.EventListener; 23 | 24 | /** 25 | * @author Christopher Butler 26 | */ 27 | public interface DockbarListener extends EventListener { 28 | 29 | //comment public is redundant in interfaces since all of the methods are by default public 30 | 31 | void dockableExpanded(DockbarEvent evt); 32 | void dockableLocked(DockbarEvent evt); 33 | void dockableCollapsed(DockbarEvent evt); 34 | 35 | void minimizeStarted(DockbarEvent evt); 36 | void minimizeCompleted(DockbarEvent evt); 37 | 38 | static class Stub implements DockbarListener { 39 | 40 | @Override 41 | public void dockableExpanded(DockbarEvent evt) {} 42 | 43 | @Override 44 | public void dockableLocked(DockbarEvent evt) {} 45 | 46 | @Override 47 | public void dockableCollapsed(DockbarEvent evt) {} 48 | 49 | @Override 50 | public void minimizeStarted(DockbarEvent evt) {} 51 | 52 | @Override 53 | public void minimizeCompleted(DockbarEvent evt) {} 54 | 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/FlexViewComponentUI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf; 21 | 22 | import javax.swing.plaf.ComponentUI; 23 | 24 | /** 25 | * @author Christopher Butler 26 | */ 27 | public abstract class FlexViewComponentUI extends ComponentUI implements IFlexViewComponentUI { 28 | protected PropertySet creationParameters; 29 | 30 | @Override 31 | public PropertySet getCreationParameters() { 32 | return creationParameters; 33 | } 34 | 35 | @Override 36 | public void setCreationParameters(PropertySet creationParameters) { 37 | this.creationParameters = creationParameters; 38 | initializeCreationParameters(); 39 | } 40 | 41 | @Override 42 | public abstract void initializeCreationParameters(); 43 | } 44 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/IFlexViewComponentUI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf; 21 | 22 | /** 23 | * @author Christopher Butler 24 | */ 25 | public interface IFlexViewComponentUI extends XMLConstants { 26 | public static final String ICON_RESOURCE = "flexdock.button.icon.resource"; 27 | 28 | public PropertySet getCreationParameters(); 29 | public void setCreationParameters(PropertySet creationParameters); 30 | public void initializeCreationParameters(); 31 | } 32 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/XMLConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf; 21 | 22 | /** 23 | * @author Christopher Butler 24 | */ 25 | public interface XMLConstants { 26 | public static final String CONSTRUCTOR_KEY = "constructor"; 27 | public static final String CLASSNAME_KEY = "classname"; 28 | public static final String REFERENCE_KEY = "ref"; 29 | public static final String ATTRIBUTE_KEY = "attribute"; 30 | public static final String PROPERTY_KEY = "property"; 31 | public static final String NAME_KEY = "name"; 32 | public static final String DESC_KEY = "description"; 33 | public static final String VALUE_KEY = "value"; 34 | public static final String EXTENDS_KEY = "extends"; 35 | public static final String HANDLER_KEY = "handler"; 36 | public static final String PROP_HANDLER_KEY = "prop-handler"; 37 | public static final String INHERITS_KEY = "inherits"; 38 | public static final String OVERRIDDEN_KEY = "flexview.element.overridden."; 39 | } 40 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/icons/IconMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf.icons; 21 | 22 | import java.util.HashMap; 23 | import java.util.Map; 24 | 25 | /** 26 | * @author Christopher Butler 27 | * 28 | */ 29 | public class IconMap extends HashMap { 30 | @Override 31 | public Object put(Object key, Object value) { 32 | // do nothing 33 | return null; 34 | } 35 | 36 | @Override 37 | public void putAll(Map m) { 38 | // do nothing 39 | } 40 | 41 | public void addAll(IconMap map) { 42 | if(map!=null) { 43 | super.putAll(map); 44 | } 45 | } 46 | 47 | public IconResource getIcons(String key) { 48 | return key==null? null: (IconResource)get(key); 49 | } 50 | 51 | public void addIcons(String key, IconResource icons) { 52 | if(key!=null && icons!=null) { 53 | super.put(key, icons); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/mappings/RefResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf.mappings; 21 | 22 | /** 23 | * @author Christopher Butler 24 | */ 25 | public class RefResolver { 26 | private String defaultRef; 27 | 28 | public void setDefaultRef(String ref) { 29 | defaultRef = ref; 30 | } 31 | 32 | public String getDefaultRef() { 33 | return defaultRef; 34 | } 35 | 36 | public String getRef(String plaf) { 37 | return getDefaultRef(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/mappings/SkinLFResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf.mappings; 21 | 22 | import javax.swing.UIManager; 23 | 24 | import com.l2fprod.gui.plaf.skin.Skin; 25 | import com.l2fprod.gui.plaf.skin.SkinLookAndFeel; 26 | 27 | /** 28 | * @author Christopher Butler 29 | */ 30 | public class SkinLFResolver extends RefResolver { 31 | 32 | @Override 33 | public String getRef(String plaf) { 34 | Skin skin = SkinLookAndFeel.getSkin(); 35 | String skinName = skin==null? null: skin.getClass().getName(); 36 | 37 | // redirect to the mapping for the skin, instead of the plaf itself 38 | String view = PlafMappingFactory.getPlafReference(skinName); 39 | return view==null? getDefaultRef(): view; 40 | } 41 | 42 | @Override 43 | public String getDefaultRef() { 44 | String systemPlaf = UIManager.getSystemLookAndFeelClassName(); 45 | return PlafMappingFactory.getPlafReference(systemPlaf); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/resources/ActionResourceHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf.resources; 21 | 22 | import javax.swing.Action; 23 | 24 | import org.flexdock.plaf.resources.action.DefaultAction; 25 | import org.flexdock.util.Utilities; 26 | 27 | /** 28 | * @author Christopher Butler 29 | */ 30 | public class ActionResourceHandler extends ResourceHandler { 31 | 32 | @Override 33 | public Object getResource(String stringValue) { 34 | Object obj = Utilities.createInstance(stringValue); 35 | if(!(obj instanceof Action)) { 36 | obj = new DefaultAction(); 37 | } 38 | return obj; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/resources/ColorResourceHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf.resources; 21 | 22 | import javax.swing.plaf.ColorUIResource; 23 | 24 | 25 | 26 | import org.flexdock.plaf.Configurator; 27 | 28 | /** 29 | * @author Christopher Butler 30 | */ 31 | public class ColorResourceHandler extends ResourceHandler { 32 | 33 | @Override 34 | public Object getResource(String stringValue) { 35 | return parseHexColor(stringValue); 36 | } 37 | 38 | public static ColorUIResource parseHexColor(String hexColor) { 39 | if(Configurator.isNull(hexColor)) { 40 | return null; 41 | } 42 | 43 | StringBuffer sb = new StringBuffer(6); 44 | int len = hexColor.length(); 45 | 46 | // strip out non-hex characters 47 | for(int i=0; iindex? getInt(args[index]): 0; 44 | } 45 | 46 | private int getInt(String data) { 47 | try { 48 | return Integer.parseInt(data); 49 | } catch(Exception e) { 50 | System.err.println("Exception: " +e.getMessage()); 51 | e.printStackTrace(); 52 | return 0; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/resources/PainterResourceHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf.resources; 21 | 22 | import org.flexdock.plaf.Configurator; 23 | import org.flexdock.plaf.PropertySet; 24 | import org.flexdock.plaf.resources.paint.Painter; 25 | import org.flexdock.plaf.resources.paint.PainterResource; 26 | 27 | /** 28 | * @author Claudio Romano 29 | * 30 | */ 31 | public class PainterResourceHandler extends ResourceHandler { 32 | 33 | public static final String PAINTER_RESOURCE_KEY = "painter-resource"; 34 | 35 | @Override 36 | public Object getResource(String stringValue) { 37 | PropertySet propertySet = Configurator.getProperties(stringValue, PAINTER_RESOURCE_KEY); 38 | PainterResource pr = createResource( propertySet); 39 | 40 | Painter p = createPainter( pr.getImplClass()); 41 | p.setPainterResource( pr); 42 | return p; 43 | } 44 | 45 | private static Painter createPainter(Class clazz) { 46 | 47 | if(clazz ==null) { 48 | return null; 49 | } 50 | 51 | try { 52 | return (Painter)clazz.newInstance(); 53 | } catch(Exception e) { 54 | System.err.println("Exception: " +e.getMessage()); 55 | e.printStackTrace(); 56 | return null; 57 | } 58 | } 59 | 60 | private static PainterResource createResource(PropertySet properties) { 61 | PainterResource painterResource = new PainterResource(); 62 | painterResource.setAll( properties); 63 | return painterResource; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/resources/PlafResourceHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf.resources; 21 | 22 | import javax.swing.UIManager; 23 | 24 | /** 25 | * @author Christopher Butler 26 | */ 27 | public class PlafResourceHandler extends ResourceHandler { 28 | @Override 29 | public Object getResource(String stringValue) { 30 | return UIManager.getDefaults().get(stringValue); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/resources/ResourceHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf.resources; 21 | 22 | import java.util.ArrayList; 23 | import java.util.StringTokenizer; 24 | 25 | /** 26 | * @author Christopher Butler 27 | */ 28 | public class ResourceHandler { 29 | public Object getResource(String stringValue) { 30 | return stringValue; 31 | } 32 | 33 | protected String[] getArgs(String data) { 34 | if(data==null) { 35 | return new String[0]; 36 | } 37 | 38 | if(!data.endsWith(",")) { 39 | data += ","; 40 | } 41 | 42 | ArrayList args = new ArrayList(3); 43 | for(StringTokenizer st = new StringTokenizer(data, ","); st.hasMoreTokens();) { 44 | args.add(st.nextToken().trim()); 45 | } 46 | return (String[])args.toArray(new String[0]); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/resources/StringResourceHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf.resources; 21 | 22 | /** 23 | * @author Christopher Butler 24 | */ 25 | public class StringResourceHandler extends ResourceHandler { 26 | @Override 27 | public Object getResource(String value) { 28 | return value; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/resources/action/DefaultAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf.resources.action; 21 | 22 | import java.awt.event.ActionEvent; 23 | 24 | import javax.swing.AbstractAction; 25 | 26 | /** 27 | * @author Christopher Butler 28 | */ 29 | public class DefaultAction extends AbstractAction { 30 | public static final DefaultAction SINGLETON = new DefaultAction(); 31 | 32 | @Override 33 | public void actionPerformed(ActionEvent e) { 34 | // noop 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/resources/border/RaisedBorderResource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf.resources.border; 21 | 22 | import java.awt.Color; 23 | import java.awt.Component; 24 | import java.awt.Graphics; 25 | import java.awt.Insets; 26 | 27 | import javax.swing.UIManager; 28 | import javax.swing.border.AbstractBorder; 29 | 30 | import org.flexdock.plaf.resources.ResourceHandler; 31 | 32 | /** 33 | * @author Claudio Romano 34 | */ 35 | public class RaisedBorderResource extends ResourceHandler { 36 | 37 | @Override 38 | public Object getResource(String data) { 39 | return new RaisedBorder(); 40 | } 41 | 42 | private static final class RaisedBorder extends AbstractBorder { 43 | private static final Color HIGHLIGHT_COLOR = UIManager.getColor("controlLtHighlight"); 44 | private static final Color CONTROL_SHADOW = UIManager.getColor("controlShadow"); 45 | 46 | private static final Insets INSETS = new Insets(1, 1, 1, 0); 47 | 48 | @Override 49 | public Insets getBorderInsets(Component c) { 50 | return INSETS; 51 | } 52 | 53 | @Override 54 | public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { 55 | g.setColor(HIGHLIGHT_COLOR); 56 | g.fillRect(0, 0, w, 1); 57 | g.fillRect(0, 1, 1, h - 1); 58 | g.setColor(CONTROL_SHADOW); 59 | g.fillRect(0, h - 1, w, 1); 60 | } 61 | } 62 | } 63 | 64 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/resources/paint/Painter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf.resources.paint; 21 | 22 | import java.awt.Graphics; 23 | 24 | import javax.swing.JComponent; 25 | 26 | /** 27 | * @author Claudio Romano 28 | */ 29 | public interface Painter { 30 | public void paint(Graphics g, int width, int height, boolean active, JComponent titlebar); 31 | 32 | public PainterResource getPainterResource(); 33 | public void setPainterResource(PainterResource painterResource); 34 | } 35 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/theme/Theme.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf.theme; 21 | 22 | /** 23 | * @author Christopher Butler 24 | */ 25 | public class Theme { 26 | private String name; 27 | private String description; 28 | 29 | private ViewUI viewUI; 30 | private TitlebarUI titlebarUI; 31 | private ButtonUI buttonUI; 32 | 33 | public ButtonUI getButtonUI() { 34 | return buttonUI; 35 | } 36 | 37 | public void setButtonUI(ButtonUI buttonUI) { 38 | this.buttonUI = buttonUI; 39 | } 40 | 41 | public TitlebarUI getTitlebarUI() { 42 | return titlebarUI; 43 | } 44 | 45 | public void setTitlebarUI(TitlebarUI titlebarUI) { 46 | this.titlebarUI = titlebarUI; 47 | } 48 | 49 | public ViewUI getViewUI() { 50 | return viewUI; 51 | } 52 | 53 | public void setViewUI(ViewUI viewUI) { 54 | this.viewUI = viewUI; 55 | } 56 | 57 | public String getDescription() { 58 | return description; 59 | } 60 | 61 | public void setDescription(String description) { 62 | this.description = description; 63 | } 64 | 65 | public String getName() { 66 | return name; 67 | } 68 | 69 | public void setName(String name) { 70 | this.name = name; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/theme/ViewUI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf.theme; 21 | 22 | import java.awt.Graphics; 23 | 24 | import javax.swing.JComponent; 25 | 26 | import org.flexdock.plaf.FlexViewComponentUI; 27 | 28 | /** 29 | * @author Christopher Butler 30 | */ 31 | public class ViewUI extends FlexViewComponentUI { 32 | 33 | @Override 34 | public void installUI(JComponent c) { 35 | super.installUI(c); 36 | } 37 | 38 | @Override 39 | public void paint(Graphics g, JComponent c) { 40 | super.paint(g, c); 41 | } 42 | 43 | @Override 44 | public void uninstallUI(JComponent c) { 45 | super.uninstallUI(c); 46 | } 47 | 48 | @Override 49 | public void initializeCreationParameters() { 50 | 51 | } 52 | 53 | public String getPreferredTitlebarUI() { 54 | return creationParameters.getString(UIFactory.TITLEBAR_KEY); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/theme/eclipse2/EclipseGradientPainter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf.theme.eclipse2; 21 | 22 | import java.awt.GradientPaint; 23 | import java.awt.Graphics; 24 | import java.awt.Graphics2D; 25 | 26 | import javax.swing.JComponent; 27 | 28 | import org.flexdock.plaf.resources.paint.DefaultPainter; 29 | 30 | /** 31 | * @author Claudio Romano 32 | */ 33 | public class EclipseGradientPainter extends DefaultPainter { 34 | 35 | @Override 36 | public void paint(Graphics g, int width, int height, boolean active, JComponent titlebar) { 37 | float center = width / 1.3f; 38 | 39 | GradientPaint firstHalf; 40 | if( active) { 41 | firstHalf = new GradientPaint(0, 0, getBackgroundColorActive(), center, 0, getBackgroundColorInactive()); 42 | } else { 43 | firstHalf = new GradientPaint(0, 0, getBackgroundColorInactive(), center, 0, getBackgroundColorInactive()); 44 | } 45 | 46 | Graphics2D g2 = (Graphics2D) g; 47 | g2.setPaint(firstHalf); 48 | g2.fillRect(0, 0, width, height); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/theme/officexp/OfficeXPPainter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf.theme.officexp; 21 | 22 | import java.awt.Color; 23 | import java.awt.GradientPaint; 24 | import java.awt.Graphics; 25 | import java.awt.Graphics2D; 26 | 27 | import javax.swing.JComponent; 28 | 29 | import org.flexdock.plaf.resources.paint.DefaultPainter; 30 | import org.flexdock.util.SwingUtility; 31 | 32 | /** 33 | * @author Claudio Romano 34 | */ 35 | public class OfficeXPPainter extends DefaultPainter { 36 | public static final String GRADIENT_COLOR = "gradient.color"; 37 | public static final String GRADIENT_COLOR_ACTIVE = "gradient.color.active"; 38 | 39 | 40 | @Override 41 | public void paint(Graphics g, int width, int height, boolean active, JComponent titlebar) { 42 | int center = (int)(height / 1.2); 43 | 44 | Color backgroundColor = getBackgroundColor(active); 45 | Color gradColor = getGradientColor(active); 46 | 47 | GradientPaint gradientPaint; 48 | if( active) { 49 | gradientPaint = new GradientPaint(0, 0, gradColor, 0, center, backgroundColor); 50 | } else { 51 | gradientPaint = new GradientPaint(0, 0, backgroundColor, 0, center, gradColor); 52 | } 53 | 54 | Graphics2D g2 = (Graphics2D) g; 55 | g2.setPaint(gradientPaint); 56 | g2.fillRect(0, 0, width, height); 57 | 58 | } 59 | 60 | protected Color getGradientColor(boolean active) { 61 | Color color = active ? painterResource.getColor( GRADIENT_COLOR_ACTIVE) : painterResource.getColor( GRADIENT_COLOR); 62 | return color == null ? SwingUtility.darker(getBackgroundColor( active), 0.75) : color; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/theme/skinlf/SkinLFPainter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf.theme.skinlf; 21 | 22 | import java.awt.Graphics; 23 | 24 | import javax.swing.JComponent; 25 | 26 | import org.flexdock.plaf.resources.paint.DefaultPainter; 27 | 28 | import com.l2fprod.gui.plaf.skin.SkinLookAndFeel; 29 | 30 | /** 31 | * @author Claudio Romano 32 | */ 33 | public class SkinLFPainter extends DefaultPainter { 34 | @Override 35 | public void paint(Graphics g, int width, int height, boolean active, JComponent titlebar) { 36 | SkinLookAndFeel.getSkin().getFrame().paintTop(g, titlebar, active, ""); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/plaf/theme/skinlf/SkinLFTitlebarUI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.plaf.theme.skinlf; 21 | 22 | import java.awt.Graphics; 23 | import java.awt.Rectangle; 24 | 25 | import org.flexdock.plaf.theme.TitlebarUI; 26 | import org.flexdock.view.Titlebar; 27 | 28 | import com.l2fprod.gui.plaf.skin.SkinLookAndFeel; 29 | 30 | /** 31 | * @author Claudio Romano 32 | */ 33 | public class SkinLFTitlebarUI extends TitlebarUI { 34 | 35 | @Override 36 | protected void paintBackground(Graphics g, Titlebar titlebar) { 37 | Rectangle paintArea = getPaintRect(titlebar); 38 | g.translate(paintArea.x, paintArea.y); 39 | SkinLookAndFeel.getSkin().getFrame().paintTop(g, titlebar, titlebar.isActive(), titlebar.getText()); 40 | g.translate(-paintArea.x, -paintArea.y); 41 | } 42 | 43 | 44 | @Override 45 | public int getDefaultHeight() { 46 | return SkinLookAndFeel.getSkin().getFrame().getTopPreferredSize().height; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/view/Button.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.view; 21 | 22 | import javax.swing.Action; 23 | import javax.swing.ButtonModel; 24 | import javax.swing.JToggleButton; 25 | import javax.swing.SwingUtilities; 26 | 27 | import org.flexdock.plaf.PlafManager; 28 | import org.flexdock.view.model.ViewButtonModel; 29 | 30 | /** 31 | * @author Christopher Butler 32 | */ 33 | public class Button extends JToggleButton { 34 | 35 | public static final String UI_CLASS_ID = "Flexdock.titlebar.button"; 36 | 37 | public Button(Action action) { 38 | setAction(action); 39 | setModel(new ViewButtonModel()); 40 | } 41 | 42 | @Override 43 | public void setModel(ButtonModel newModel) { 44 | ButtonModel oldModel = getModel(); 45 | if(newModel!=null && oldModel!=null) { 46 | newModel.setSelected(oldModel.isSelected()); 47 | } 48 | super.setModel(newModel); 49 | } 50 | 51 | @Override 52 | public void updateUI() { 53 | setUI(PlafManager.getUI(this)); 54 | } 55 | 56 | @Override 57 | public String getUIClassID() { 58 | return UI_CLASS_ID; 59 | } 60 | 61 | public View getView() { 62 | return (View)SwingUtilities.getAncestorOfClass(View.class, this); 63 | } 64 | 65 | public String getActionName() { 66 | Action action = getAction(); 67 | if(action==null) { 68 | return null; 69 | } 70 | return (String)action.getValue(Action.NAME); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/view/actions/ActionFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.view.actions; 21 | 22 | public class ActionFactory { 23 | 24 | public static DefaultCloseAction createCloseAction() { 25 | return new DefaultCloseAction(); 26 | } 27 | 28 | public static DefaultDisplayAction createDisplayAction() { 29 | return new DefaultDisplayAction(); 30 | } 31 | 32 | public static DefaultPinAction createPinAction() { 33 | return new DefaultPinAction(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/view/actions/DefaultCloseAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.view.actions; 21 | 22 | import java.awt.event.ActionEvent; 23 | 24 | import org.flexdock.docking.DockingManager; 25 | import org.flexdock.view.View; 26 | 27 | /** 28 | * @author Christopher Butler 29 | */ 30 | public class DefaultCloseAction extends ViewAction { 31 | 32 | public DefaultCloseAction() { 33 | 34 | } 35 | 36 | @Override 37 | public void actionPerformed(View view, ActionEvent evt) { 38 | DockingManager.close(view); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/view/actions/DefaultDisplayAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.view.actions; 21 | 22 | import java.awt.event.ActionEvent; 23 | 24 | import javax.swing.Action; 25 | 26 | import org.flexdock.docking.DockingManager; 27 | import org.flexdock.view.View; 28 | 29 | /** 30 | * @author Christopher Butler 31 | */ 32 | public class DefaultDisplayAction extends ViewAction { 33 | 34 | public DefaultDisplayAction() { 35 | 36 | } 37 | 38 | public DefaultDisplayAction(String viewId) { 39 | setViewId(viewId); 40 | View view = View.getInstance(viewId); 41 | if(view!=null) { 42 | putValue(Action.NAME, view.getTitle()); 43 | } 44 | } 45 | 46 | @Override 47 | public void actionPerformed(View view, ActionEvent evt) { 48 | DockingManager.display(view); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/view/actions/DefaultPinAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.view.actions; 21 | 22 | import java.awt.event.ActionEvent; 23 | 24 | import javax.swing.ButtonModel; 25 | 26 | import org.flexdock.docking.DockingManager; 27 | import org.flexdock.docking.state.DockingState; 28 | import org.flexdock.view.Button; 29 | import org.flexdock.view.View; 30 | import org.flexdock.view.model.ViewButtonModel; 31 | 32 | /** 33 | * @author Christopher Butler 34 | * @author Bobby Rosenberger 35 | */ 36 | public class DefaultPinAction extends ViewAction { 37 | 38 | public DefaultPinAction() { 39 | 40 | } 41 | 42 | @Override 43 | public void actionPerformed(View view, ActionEvent evt) { 44 | boolean minimize = view.isMinimized()? false: true; 45 | DockingManager.setMinimized(view, minimize); 46 | } 47 | 48 | public void updateState(View view, DockingState info, Button button) { 49 | button.getModel().setSelected(info.isMinimized()); 50 | } 51 | 52 | @Override 53 | public ButtonModel createButtonModel() { 54 | return new PinButtonModel(); 55 | } 56 | 57 | private static class PinButtonModel extends ViewButtonModel { 58 | @Override 59 | public boolean isSelected() { 60 | DockingState info = getDockingState(); 61 | if(info==null) { 62 | return super.isSelected(); 63 | } 64 | return info.isMinimized(); 65 | } 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/view/actions/ViewAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.view.actions; 21 | 22 | import java.awt.Component; 23 | import java.awt.event.ActionEvent; 24 | 25 | import javax.swing.AbstractAction; 26 | import javax.swing.ButtonModel; 27 | import javax.swing.SwingUtilities; 28 | 29 | import org.flexdock.view.View; 30 | 31 | /** 32 | * @author Christopher Butler 33 | */ 34 | public abstract class ViewAction extends AbstractAction { 35 | /** 36 | * @deprecated unused 37 | */ 38 | public static final ViewAction EMPTY_ACTION = createDefault(); 39 | 40 | protected String viewId; 41 | 42 | protected View getView(ActionEvent evt) { 43 | View view = viewId == null ? null : View.getInstance(viewId); 44 | if (view == null) { 45 | Component c = (Component) evt.getSource(); 46 | view = (View) SwingUtilities.getAncestorOfClass(View.class, c); 47 | } 48 | return view; 49 | } 50 | 51 | @Override 52 | public void actionPerformed(ActionEvent e) { 53 | View view = getView(e); 54 | actionPerformed(view, e); 55 | } 56 | 57 | public abstract void actionPerformed(View view, ActionEvent evt); 58 | 59 | private static ViewAction createDefault() { 60 | return new ViewAction() { 61 | @Override 62 | public void actionPerformed(View view, ActionEvent evt) { 63 | 64 | } 65 | }; 66 | } 67 | 68 | public ButtonModel createButtonModel() { 69 | return null; 70 | } 71 | 72 | public String getViewId() { 73 | return viewId; 74 | } 75 | 76 | public void setViewId(String viewId) { 77 | this.viewId = viewId; 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /flexdock-view/src/main/java/org/flexdock/view/model/ViewButtonModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy 3 | * of this software and associated documentation files (the "Software"), to deal 4 | * in the Software without restriction, including without limitation the rights 5 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | * copies of the Software, and to permit persons to whom the Software is 7 | * furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | * SOFTWARE. 19 | */ 20 | package org.flexdock.view.model; 21 | 22 | import javax.swing.JToggleButton; 23 | 24 | import org.flexdock.docking.DockingManager; 25 | import org.flexdock.docking.state.DockingState; 26 | import org.flexdock.view.View; 27 | 28 | /** 29 | * @author Christopher Butler 30 | */ 31 | public class ViewButtonModel extends JToggleButton.ToggleButtonModel { 32 | private String viewId; 33 | 34 | public String getViewId() { 35 | return viewId; 36 | } 37 | public void setViewId(String viewId) { 38 | this.viewId = viewId; 39 | } 40 | 41 | protected View getView() { 42 | return View.getInstance(getViewId()); 43 | } 44 | 45 | protected synchronized DockingState getDockingState() { 46 | return DockingManager.getDockingState(getViewId()); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/eclipse2/close_default.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/eclipse2/close_default.gif -------------------------------------------------------------------------------- /flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/eclipse2/min_default.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/eclipse2/min_default.gif -------------------------------------------------------------------------------- /flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/eclipse2/pin_default.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/eclipse2/pin_default.gif -------------------------------------------------------------------------------- /flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/close_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/close_active.png -------------------------------------------------------------------------------- /flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/close_default.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/close_default.gif -------------------------------------------------------------------------------- /flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/close_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/close_default.png -------------------------------------------------------------------------------- /flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/close_disabled_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/close_disabled_active.png -------------------------------------------------------------------------------- /flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/close_disabled_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/close_disabled_default.png -------------------------------------------------------------------------------- /flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/min_default.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/min_default.gif -------------------------------------------------------------------------------- /flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/pin_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/pin_active.png -------------------------------------------------------------------------------- /flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/pin_active_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/pin_active_selected.png -------------------------------------------------------------------------------- /flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/pin_default.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/pin_default.gif -------------------------------------------------------------------------------- /flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/pin_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/pin_default.png -------------------------------------------------------------------------------- /flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/pin_default_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/pin_default_selected.png -------------------------------------------------------------------------------- /flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/pin_disabled_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/pin_disabled_active.png -------------------------------------------------------------------------------- /flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/pin_disabled_active_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/pin_disabled_active_selected.png -------------------------------------------------------------------------------- /flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/pin_disabled_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/pin_disabled_default.png -------------------------------------------------------------------------------- /flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/pin_disabled_default_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencollab/flexdock/3de5614aff8d0b054eef8b4587842a76b28d3997/flexdock-view/src/main/resources/org/flexdock/plaf/titlebar/win32/pin_disabled_default_selected.png -------------------------------------------------------------------------------- /webstart/flexdockdemo.jnlp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | FlexDock Demo 5 | felxdock.dev.java.net 6 | 7 | FlexDock is a Swing-based Java docking framework distributed under the MIT license. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | --------------------------------------------------------------------------------