blob: cfb7b6d15a3e229a39c1ae38fef3fed4a308ed14 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<meta name="author" content="kris.richards@sun.com">
<link rel="stylesheet" href="https://netbeans.org/netbeans.css" type="text/css">
<title>Visual Library Examples</title>
<style type="text/css"><!--
pre {
border: 1px solid black;
padding: 10px;
background-color: #FFD;
}
table.framed {
border: 2px solid black;
border-collapse: collapse;
border-spacing: 1px solid black;
}
table.framed th {
background-color: #FFD;
padding: 5px;
border: 2px solid black;
vertical-align: top;
}
table.framed td {
padding: 5px;
border: 1px solid black;
vertical-align: top;
}
code {
background-color: #FFD;
border: 1px solid #DD0;
}
--></style>
</head>
<body>
<h1>Visual Library Examples</h1>
<p>There are a number of examples that can be used as a guide for writing code
to the NetBeans Visual Library.</p>
<p>Download the
ZIP file below and unzip it:</p>
<p><a href="visual.examples.zip">Simple NetBeans Application Project</a> </p>
<p>This will produce a NetBeans Java Application
project. Open it in NetBeans IDE. A long list of examples, the first few of
which are shown below, will be available.</p>
<p><img alt="Visual Samples" src="screenshots/visual-samples.png"></p>
<p>Simply run the project. A dialog containing a
list of all the examples will appear. Double-click any of the items in the
list to run the example. Note that all the supporting code for the examples
is in the project. This is a good source for learning how to use the NetBeans
Visual Library APIs.</p>
<h2>List of Examples</h2>
<ul>
<li><strong>javaone.demo1.IconNodeWidget</strong> - how to create a composite widget
<li><strong>javaone.demo2.ActionDemo</strong> - how to use actions
<li><strong>javaone.demo3.ConnectionDemo</strong> - how to use <code>ConnectionWidget</code>
<li><strong>javaone.demo4.GraphDemo</strong> - how to use graph-oriented scene implemented using <code>GraphScene</code>
<li><strong>javaone.demo5.ManyObjectsDemo</strong> - performance test of 1113 nodes and 1110 edges on a single scene. Zoom-out to see more.
<li><strong>javaone.demo6.LODDemo</strong> - how to use <code>LevelOfDetailsWidget</code>. Zoom-in to see more.
<li><strong>test.action.ActionMapActionTest</strong> - how to use <code>ActionMapAction</code>
<li><strong>test.action.PanActionTest</strong> - test of <code>PanAction</code>
<li><strong>test.action.PopupMenuActionTest</strong> - test of <code>PopupMenuAction</code>
<li><strong>test.action.SelectLockedActionTest</strong> - example of proper cooperation of select (which opens another Swing windows) and locking action
<li><strong>test.action.WheelPanActionTest</strong> - how to use <code>WheelPanAction</code>
<li><strong>test.alignwith.AlignWithClientAreaTest</strong> - test of #105285 - align-with action with checking client area of widgets only
<li><strong>test.alignwith.AlignWithMoveGuideLinesTest</strong> - test of #97034 - incorrectly painted guide-lines for <code>MoveAlignWithAction</code>
<li><strong>test.alignwith.AlignWithTest</strong> - how to use <code>MoveAlignWithAction</code>
<li><strong>test.alignwith.AlignWithResizeTest</strong> - how to use <code>AlignWithMoveAction</code> and <code>AlignWithResizeAction</code>
<li><strong>test.anchor.ArrowAnchorShapeTest</strong> - test of <code>ArrowAnchorShape</code>
<li><strong>test.anchor.AnchorShapeWidthTest</strong> - test of bugfix #91613 - Incorrectly rendered AnchorShapes
<li><strong>test.anchor.ImageAnchorShapeTest</strong> - test of <code>ImageAnchorShape</code>
<li><strong>test.anchor.InvalidAnchorNegativeTest</strong> - negative test of invalid anchor (its related widget is not added into scene)
<li><strong>test.animator.AnimatorTest</strong> - how to use preferred-location animator
<li><strong>test.animator.ColorAnimatorTest</strong> - how to use background/foreground animator
<li><strong>test.bird.BirdViewTest</strong> - how to use bird view
<li><strong>test.card.CardContainerWidget</strong> - how to use <code>CardLayout</code>
<li><strong>test.component.ComponentTest</strong> - shows AWT/Swing integration
<li><strong>test.component.ComponentModeTest</strong> - shows adding/removing modes of <code>ComponentWidget</code>
<li><strong>test.connect.ConnectActionLockTest</strong> - test of bugfix #120766 - missing check in lockable actions
<li><strong>test.connect.ConnectScene</strong> - how to <code>ConnectAction</code> and <code>ReconnectAction</code>
<li><strong>test.connect.ExtendedConnectTest</strong> - test of <code>ExtendedConnectAction</code>
<li><strong>test.connectionlabels.ConnectionLabelsTest</strong> - how to attach labels to <code>ConnectionWidget</code>
<li><strong>test.connectionlabels.LabelsWithSameAnchorTest</strong> - test for issue #121215 - Labels Overlap
<li><strong>test.constraint.ConstraintsTest</strong> - how to use widget constraints
<li><strong>test.context.ContextTest</strong> - test of mouse-cursor context resolving
<li><strong>test.controlpoint.AddRemoveControlPointTest</strong> - how to use <code>AddRemoveControlPointAction</code> and <code>MoveControlPointAction</code>
<li><strong>test.controlpoint.ControlPointsCursorTest</strong> - test of <code>ConnectionWidget.controlPointsCursor</code> property
<li><strong>test.convolve.ConvolveTest</strong> - how to use <code>ConvolveWidget</code>
<li><strong>test.custom.CustomWidgetTest</strong> - how to create a custom widget
<li><strong>test.devolve.DevolveTest</strong> - how to use scene-layout
<li><strong>test.enable.EnableTest</strong> - how to use <code>Widget.setEnable</code> method
<li><strong>test.expand.MouseOverExpandTest</strong> - how to create expand/collapse details functionality
<li><strong>test.expand.ProxyAnchorExpandTest</strong> - how to use proxy anchor for expanding/collapsing functionality
<li><strong>test.freeconnect.FreeConnectTest</strong> - how to <code>AddRemoveControlPointAction</code>, <code>FreeConnectionWidget</code>, <code>FreeRectangularAnchor</code> and <code>FreeRouter</code>
<li><strong>test.general.GraphSceneTest</strong> - how to use <code>GraphScene</code>
<li><strong>test.graph.GraphRemoveTest</strong> - test of <code>GraphPinScene.remove*WithEdges</code>
<li><strong>test.graph.GraphTest</strong> - test of bug fix on <code>GraphScene.removeNode</code>
<li><strong>test.graph.LoopEdgeTest</strong> - how to create a loop edge
<li><strong>test.graphlayout.GridGraphLayoutTest</strong> - how to use <code>GridGraphLayout</code>
<li><strong>test.graphlayout.TreeGraphLayoutTest</strong> - how to implement graph-oriented scene layout
<li><strong>test.huge.HugeTest</strong> - similar to javaone.demo5.ManyObjectsDemo
<li><strong>test.inplace.ExpansionDirectionsTest</strong> - how to specify expansion directions for <code>TextFieldInplaceEditor</code>
<li><strong>test.inplace.InplaceEditorTest</strong> - how to use <code>TextFieldInplaceEditor</code>
<li><strong>test.inplace.InvokeInplaceEditorTest</strong> - how to invoke in-place editor programatically
<li><strong>test.inplace.JustifyAlignmentTest</strong> - test in-place text editor with justify layout of labels with right alignment
<li><strong>test.inplace.RequestFocusTest</strong> - test of bugfix #96348 - requestFocus is not forwarded while editor is closing
<li><strong>test.justify.JustifyTest</strong> - test of layout justification
<li><strong>test.keyboard.EnterKeyProcessingTest</strong> - test of processing enter key
<li><strong>test.keyboard.EnterKeyTest</strong> - test of cooperation of Swing with an enter key processing within in-place editor
<li><strong>test.keyboard.KeyboardTest</strong> - test of <code>CycleObjectSceneFocusAction</code>
<li><strong>test.label.LabelGlyphVectorTest</strong> - test of <code>LabelWidget</code> rendering using glyph vector
<li><strong>test.label.LabelOrientationTest</strong> - test of orientation vs. alignment of text in <code>LabelWidget</code>
<li><strong>test.layout.CardLayoutWithLabelTest</strong> - how to create non-jumping widget with card layout and label widget as child
<li><strong>test.layout.FlowLayoutTest</strong> - test of bugfix #105400 - FlowLayout does not work correctly with negative location of child widgets
<li><strong>test.layout.MinMaxFlowLayoutTest</strong> - test of <code>FlowLayout</code> cooperation with minimal size
<li><strong>test.layout.OverlayLayoutWidgetTest</strong> - test of justification of <code>OverlayLayout</code>
<li><strong>test.layout.WeightFlowLayoutTest</strong> - how to use weights in <code>FlowLayout</code>
<li><strong>test.list.ListTest</strong> - how to use <code>ListWidget</code> and <code>ListItemWidget</code>
<li><strong>test.listeners.ObjectSceneListenerTest</strong> - how to use <code>ObjectSceneListener</code>
<li><strong>test.lod.LevelOfDetailsTest</strong> - how to use <code>LevelOfDetailsWidget</code>
<li><strong>test.lod.TwoLimitsLevelOfDetailsTest</strong> - test of bugfix #123711 - Fade between soft/hard max in LevelOfDetailsWidget
<li><strong>test.move.SnapToGridTest</strong> - how to use snap-to-grid move strategy
<li><strong>test.multiline.MultiLineTest</strong> - how to create a multi-line label using <code>JLabel</code>
<li><strong>test.multiview.MultiViewTest</strong> - how to create satellite views
<li><strong>test.multiview.MultiViewTableTest</strong> - how to create satellite views
<li><strong>test.object.MultiMoveActionTest</strong> - how to implement <code>MoveAction</code> for multiple objects
<li><strong>test.object.MultipleWidgetsTest</strong> - how to use <code>ObjectScene</code> for 1-N mapping between objects and widgets
<li><strong>test.object.ObjectTest</strong> - how to use <code>ObjectScene</code>
<li><strong>test.order.ReverseOrderWidgetDependencyTest</strong> - how to implement a connection widget behind a related widgets
<li><strong>test.repaint.RepaintTest</strong> - test of bugfix of repaint of <code>ConnectionWidget</code>
<li><strong>test.resize.ResizeTest</strong> - how to use <code>ResizeAction</code>
<li><strong>test.router.OSRCollisionsCollectorTest</strong> - test of bugfix #96462 - Incorrectly routed path by OrthogonalSearchRouter when a target in collision region
<li><strong>test.router.OSRComputeControlPointsTest</strong> - test of bugfix #96460 - Wrong control points computation in OrthogonalSearchRouter
<li><strong>test.routing.ActionsWithRoutingPolicyTest</strong> - how to use routing policy with <code>AddRemoveControlPointAction</code> and <code>MoveControlPointAction</code>
<li><strong>test.routing.RoutingPolicyTest</strong> - how to use routing policy of <code>ConnectionWidget</code>
<li><strong>test.sceneresize.LimitedSceneTest</strong> - test of cooperation of <code>OrthogonalSearchRouter</code> with <code>Scene.maximumBounds</code> property
<li><strong>test.sceneresize.SceneResizeTest</strong> - test of bugfix #84604 - scene resize based on Scene view component
<li><strong>test.scroll.ScrollTest</strong> - how to use <code>ScrollWidget</code> for scrollable view
<li><strong>test.scroll.SwingScrollTest</strong> - how to use <code>SwingScrollWidget</code> for scrollable view which uses <code>JScrollBar</code> from Swing
<li><strong>test.serialization.SceneSerializerTest</strong> - how to implement serialization of graph scene where nodes and edges are represented as Long objects
<li><strong>test.swing.JButtonWidgetTest</strong> - how to implement zoom-able JButton
<li><strong>test.swingborder.SwingBorderTest</strong> - how to use borders for Swing
<li><strong>test.tool.CtrlKeySwitchToolTest</strong> - how to create active-tool switching using ctrl key
<li><strong>test.tool.ToolTest</strong> - how to use action-tools
<li><strong>test.view.OffscreenRenderingTest</strong> - how to off-screen render a scene
<li><strong>test.view.TooltipTest</strong> - test of tool-tips
<li><strong>test.visible.NotifyAddedRemovedTest</strong> - test of <code>Widget.notifyAdded</code> and <code>Widget.notifyRemoved</code> methods
<li><strong>test.visible.VisibilityTest</strong> - compatibility test of <code>Layout</code> implementations with <code>Widget.visible</code> property
<li><strong>test.vmd.VMDCollisionTest</strong> - test of <code>WidgetCollisionCollector</code>
<li><strong>test.vmd.VMDColorSchemeTest</strong> - how to use <strong>VMDColorScheme</strong>
<li><strong>test.vmd.VMDTest</strong> - how to use <strong>VMD</strong> plug-in
<li><strong>test.widget.AnimatedImageTest</strong> - test of animated image in ImageWidget
<li><strong>test.widget.ConnectionWidgetCutDistanceTest</strong> - how to use control point cut distance in <code>ConnectionWidget</code>
<li><strong>test.widget.ConnectionWidgetOrderTest</strong> - test of widget order using connection widgets
<li><strong>test.widget.IconNodeHeaderTest</strong> - how to implement relative header to an IconNodeWidget
<li><strong>test.widget.RelativeDecorationTest</strong> - how to implement decoration relatively to widget location
<li><strong>test.zoom.CenteredZoomTest</strong> - how to use <code>CenteredZoomAction</code>
<li><strong>test.zoom.FitToViewTest</strong> - how to implement fit-to-view feature
<li><strong>test.zoom.MouseCenteredZoomTest</strong> - how to use <code>MouseCenteredZoomAction</code>
</ul>
</body>