NetBeans Visual Library

kaputmaltwormΛογισμικό & κατασκευή λογ/κού

15 Αυγ 2012 (πριν από 5 χρόνια και 2 μέρες)

493 εμφανίσεις



1
NetBeans Visual Library
Institute for System Software
Johannes Kepler University Linz, Austria
http://ssw.jku.at
Thomas Wuerthinger
wuerthinger@ssw.jku.at


2
Introduction

Visualization library

Light-weight window system

Based on Java2D
Important concepts:

Widget

WidgetAction

ConnectionWidget and Anchor

Specialized Scene


3
Widget

Light-weight graphical component

Tree hierarchy similar to Swing components

Efficient validation / repaint mechanisms
Widget
has * children
WidgetAction
has * associated actions
ObjectState
has 1 state
isSelected
isHovered
isHighlighted
isFocused
...
getBounds
isHitAt
paintWidget
getLookup
...


4
Scene

Top-level widget

Displayed in Swing component
Widget
Scene
inherits
JComponent
createView
createSatelliteView
getFocusedWidget
getZoomFactor
SceneAnimator
getSceneAnimator
createSatelliteView


5
WidgetAction

WidgetAction chain associated with component

ActionFactory for creating predefined actions:

createZoomAction

createPanAction

createWheelPanAction

createSelectAction

createResizeAction

createMoveAction

...
WidgetAction
WidgetAction
WidgetAction


6
Connection

Top-level widget

Displayed in Swing component
Widget
ConnectionWidget
inherits
Anchor
getSourceAnchor
Router
getRouter
getTargetAnchor
getRelatedWidget


7
Connection Example
Widget1
Target Anchor
Widget2
Source Anchor
Control points specified by the Router


8
Anchor Types

Center Anchor

Circular Anchor

Fixed Anchor

Rectangular Anchor


9
Router Types

Direct Router

Orthogonal Router
Router
List<Point> routeConnection(ConnectionWidget widget)


10
SceneAnimator

Create animations on widgets
Scene
SceneAnimator
getSceneAnimator
animateBackgroundColor
animateForegroundColor
animatePreferredBounds
animatePreferredLocation
animateZoomFactor
...


11
Specialized Scene
Scene
ObjectScene
GraphScene
GraphPinScene

Associate a Java object with a widget

Graph model
addObject
getSelectedObjects
findObject
findWidget
...