|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.javagl.swogl.SwoglContainer
public final class SwoglContainer
This class is a container for SwoglComponent
s. It is
responsible for the interaction and rendering of the
SwoglComponents.
Method Summary | |
---|---|
void |
add(SwoglComponent swoglComponent)
Adds the given SwoglComponent to this SwoglContainer |
IntersectionInfo |
computeIntersectionInfo(java.awt.Point pointInSwoglContainer)
Compute the closest IntersectionInfo for the given point. |
java.util.List<IntersectionInfo> |
computeIntersectionInfos(java.awt.Point pointInSwoglContainer)
Compute the IntersectionInfos for the given
point. |
PickingInfo |
computePickingInfo(java.awt.Point pointInSwoglContainer)
Compute the PickingInfo for the given point. |
Ray |
computePickingRay(java.awt.Point pointInSwoglContainer)
Computes the picking Ray that results from a picking at
the given point. |
static SwoglContainer |
create(java.awt.Component visibleComponent,
SwoglComponentHandler swoglComponentHandler,
PickingRayComputer pickingRayComputer)
Creates a new, empty SwoglContainer that shows the given visibleComponent. |
static SwoglContainer |
create(java.awt.Component visibleComponent,
SwoglSetup swoglSetup)
Creates a new, empty SwoglContainer that shows the given visibleComponent and obtains the SwoglComponentHandler and PickingRayComputer from the given SwoglSetup. |
static SwoglContainer |
create(SwoglApplication swoglApplication)
Creates a new, empty SwoglContainer for the given SwoglApplication. |
LayoutManager3D |
getLayout3D()
Returns the current LayoutManager3D |
javax.swing.JComponent |
getMainComponent()
Returns the main component of this SwoglContainer. |
SwoglComponent |
getSwoglComponent(int index)
Returns the SwoglComponent with the given index |
int |
getSwoglComponentCount()
Returns the number of SwoglComponents that are currently present in this SwoglContainer |
void |
remove(int index)
Removes the SwoglComponent with the given index |
void |
remove(SwoglComponent swoglComponent)
Removes the given SwoglComponent from this SwoglContainer |
void |
removeAll()
Removes all SwoglComponents |
void |
repaint()
Causes a repaint of the visible component of this SwoglContainer. |
void |
setLayout3D(LayoutManager3D newLayoutManager3D)
Set the LayoutManager3D that should be used by this SwoglContainer to lay out its SwoglComponents |
void |
setMouseEventDispatchingConditions(Condition<java.awt.event.MouseEvent> listenerDispatchingCondition,
Condition<java.awt.event.MouseEvent> swoglComponentDispatchingCondition)
Set the conditions for the dispatching of MouseEvents to either the listeners that are attached to the main component of this SwoglContainer, or to the SwoglComponents inside this SwoglContainer. |
void |
validate3D()
Will cause the LayoutManager3D of this SwoglContainer to be called in order to update the layout of the SwoglComponents. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static SwoglContainer create(SwoglApplication swoglApplication)
create(Component, SwoglComponentHandler,
PickingRayComputer)
.
swoglApplication
- The SwoglApplication. May not be null.
public static SwoglContainer create(java.awt.Component visibleComponent, SwoglSetup swoglSetup)
create(Component, SwoglComponentHandler,
PickingRayComputer)
.
visibleComponent
- The visible component. May not be null.swoglSetup
- The SwoglSetup. May not be null.
public static SwoglContainer create(java.awt.Component visibleComponent, SwoglComponentHandler swoglComponentHandler, PickingRayComputer pickingRayComputer)
SwoglComponentHandler.handleSwoglComponent(SwoglComponent)
method of the given SwoglComponentHandler will be called, and when
it is removed, the
SwoglComponentHandler.releaseSwoglComponent(SwoglComponent)
will be called. The SwoglComponentHandler is thus responsible for
maintaining the rendered state of the SwoglComponents.setMouseEventDispatchingConditions(Condition, Condition)
.
By default, both conditions are true
.
visibleComponent
- The visible component. May not be null.swoglComponentHandler
- The SwoglComponentHandler. May not be null.pickingRayComputer
- The picking ray computer. May not be null.
public javax.swing.JComponent getMainComponent()
public void setMouseEventDispatchingConditions(Condition<java.awt.event.MouseEvent> listenerDispatchingCondition, Condition<java.awt.event.MouseEvent> swoglComponentDispatchingCondition)
listenerDispatchingCondition
- The condition that checks whether
an event should be dispatched to the listeners that are attached to
the main component.swoglComponentDispatchingCondition
- The condition that checks
whether an event should be dispatched to the SwoglComponentspublic Ray computePickingRay(java.awt.Point pointInSwoglContainer)
Ray
that results from a picking at
the given point. The direction of the returned ray is normalized.
pointInSwoglContainer
- The point inside this SwoglContainer
public java.util.List<IntersectionInfo> computeIntersectionInfos(java.awt.Point pointInSwoglContainer)
IntersectionInfos
for the given
point. A picking ray will be computed and intersected with all
SwoglComponents. For each intersection, an IntersectionInfo will be
created. An unmodifiable (possibly empty) list of all
IntersectionInfos will be returned. The list will contain the
IntersectionInfos ordered by their distance along the picking ray,
with the closest intersection first.
pointInSwoglContainer
- The point inside this SwoglContainer
public IntersectionInfo computeIntersectionInfo(java.awt.Point pointInSwoglContainer)
IntersectionInfo
for the given point.
A picking ray will be computed and intersected with all
SwoglComponents. If the ray intersects at least one SwoglComponent,
then the IntersectionInfo for the closest intersection will be
returned. Otherwise, null
will be returned.
pointInSwoglContainer
- The point inside this SwoglContainer
public PickingInfo computePickingInfo(java.awt.Point pointInSwoglContainer)
pointInSwoglContainer
- The point inside this SwoglContainer
public void setLayout3D(LayoutManager3D newLayoutManager3D)
newLayoutManager3D
- The LayoutManager3D to usepublic LayoutManager3D getLayout3D()
public void validate3D()
public void add(SwoglComponent swoglComponent)
swoglComponent
- The SwoglComponent to addpublic void remove(SwoglComponent swoglComponent)
swoglComponent
- The SwoglComponent to removepublic void remove(int index)
index
- The index of the SwoglComponent to removepublic void removeAll()
public int getSwoglComponentCount()
public SwoglComponent getSwoglComponent(int index)
index
- The index of the SwoglComponent
public void repaint()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |