Gridarta Editor
net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R > Class Template Reference

This dialog manages the find action. More...

+ Inheritance diagram for net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
+ Collaboration diagram for net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:

Public Member Functions

void display (@NotNull final MapView< G, A, R > mapView)
 Replace objects on the map. More...
 
void dispose (@NotNull final MapView< G, A, R > mapView)
 Disposes the find dialog. More...
 
boolean findAgain (@NotNull final MapView< G, A, R > mapView, final boolean forward, final boolean performAction)
 Re-executes the previous find operation. More...
 
void findCancel ()
 Action method for Cancel button. More...
 
 FindDialog (@NotNull final Component parent)
 Creates a new instance. More...
 
void findOk ()
 Action method for Ok button. More...
 

Private Member Functions

int doFind (@NotNull final Iterable< MatchCriteria< G, A, R >> matchCriterias, final boolean forward)
 This method performs the actual find action on a map. More...
 
boolean doFind (final boolean forward)
 Executes one find operation. More...
 
void selectMapSquares (@NotNull final Iterable< MapSquare< G, A, R >> mapSquares)
 Selects a set of MapSquares on the map. More...
 
void setMapCursor (final boolean forward, @NotNull final List< G > gameObjects)
 Moves the cursor to the next or previous matching game object. More...
 

Private Attributes

final JDialog dialog
 The dialog instance. More...
 
final AbstractButton findArchCheckbox = new JCheckBox(ActionBuilderUtils.getString(ACTION_BUILDER, "findWhereArch"))
 The checkbox for matching archetype names. More...
 
final AbstractButton findFaceCheckbox = new JCheckBox(ActionBuilderUtils.getString(ACTION_BUILDER, "findWhereFace"))
 The checkbox for matching 'face' or 'animation' attributes. More...
 
final JTextComponent findInput = new JTextField(20)
 The text input field for the string to find. More...
 
final AbstractButton findMsgCheckbox = new JCheckBox(ActionBuilderUtils.getString(ACTION_BUILDER, "findWhereMsg"))
 The checkbox for matching 'msg' attributes. More...
 
final AbstractButton findNameCheckbox = new JCheckBox(ActionBuilderUtils.getString(ACTION_BUILDER, "findWhereName"))
 The checkbox for matching 'name' attributes. More...
 
final AbstractButton findOtherCheckbox = new JCheckBox(ActionBuilderUtils.getString(ACTION_BUILDER, "findWhereOther"))
 The checkbox for matching all other attributes. More...
 
final AbstractButton findSlayingCheckbox = new JCheckBox(ActionBuilderUtils.getString(ACTION_BUILDER, "findWhereSlaying"))
 The checkbox for matching 'slaying' attributes. More...
 
boolean isBuilt
 Whether this find dialog has been displayed. More...
 
MapView< G, A, R > mapView
 The MapView to operate on. More...
 
final Component parent
 The parent component for dialogs. More...
 

Static Private Attributes

static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta")
 Action Builder. More...
 
static final long serialVersionUID = 1L
 Serial Version UID. More...
 

Detailed Description

This dialog manages the find action.

Author
Andreas Kirschbaum

Definition at line 67 of file FindDialog.java.

Constructor & Destructor Documentation

◆ FindDialog()

net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.FindDialog ( @NotNull final Component  parent)

Creates a new instance.

Parameters
parentthe parent component for dialogs

Definition at line 149 of file FindDialog.java.

Member Function Documentation

◆ display()

void net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.display ( @NotNull final MapView< G, A, R >  mapView)

Replace objects on the map.

Parameters
mapViewmap view of the active map where the action was invoked

Definition at line 162 of file FindDialog.java.

Referenced by net.sf.gridarta.gui.dialog.find.FindDialogManager< G, A, R >.showDialog().

+ Here is the caller graph for this function:

◆ dispose()

void net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.dispose ( @NotNull final MapView< G, A, R >  mapView)

Disposes the find dialog.

Parameters
mapViewthe map view to dispose the dialog of; do nothing if no

Definition at line 362 of file FindDialog.java.

Referenced by net.sf.gridarta.gui.dialog.find.FindDialogManager< G, A, R >.disposeDialog().

+ Here is the caller graph for this function:

◆ doFind() [1/2]

int net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doFind ( @NotNull final Iterable< MatchCriteria< G, A, R >>  matchCriterias,
final boolean  forward 
)
private

This method performs the actual find action on a map.

Parameters
matchCriteriasthe matching criterias to find
forwardwhether to search forward (
true
) or backward (
false
)
Returns
the number of objects found

Definition at line 290 of file FindDialog.java.

◆ doFind() [2/2]

boolean net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doFind ( final boolean  forward)
private

Executes one find operation.

Parameters
forwardwhether to search forward (
true
) or backward (
false
)
Returns
whether the find operation was successful

Definition at line 258 of file FindDialog.java.

Referenced by net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.doFind(), net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.findAgain(), and net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.findOk().

+ Here is the caller graph for this function:

◆ findAgain()

boolean net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.findAgain ( @NotNull final MapView< G, A, R >  mapView,
final boolean  forward,
final boolean  performAction 
)

Re-executes the previous find operation.

Parameters
mapViewthe map view to operate on
forwardwhether to search forward (
true
) or backward (
false
)
performActionwhether the action should be performed
Returns
whether the action was or can be performed

Definition at line 224 of file FindDialog.java.

Referenced by net.sf.gridarta.gui.dialog.find.FindDialogManager< G, A, R >.findNext(), and net.sf.gridarta.gui.dialog.find.FindDialogManager< G, A, R >.findPrev().

+ Here is the caller graph for this function:

◆ findCancel()

void net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.findCancel ( )

Action method for Cancel button.

Definition at line 248 of file FindDialog.java.

◆ findOk()

void net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.findOk ( )

Action method for Ok button.

Definition at line 238 of file FindDialog.java.

◆ selectMapSquares()

void net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.selectMapSquares ( @NotNull final Iterable< MapSquare< G, A, R >>  mapSquares)
private

Selects a set of MapSquares on the map.

Parameters
mapSquaresthe map squares to select

Definition at line 318 of file FindDialog.java.

Referenced by net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.doFind().

+ Here is the caller graph for this function:

◆ setMapCursor()

void net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setMapCursor ( final boolean  forward,
@NotNull final List< G >  gameObjects 
)
private

Moves the cursor to the next or previous matching game object.

Parameters
forwardwhether to move the cursor forward (
true
) or backward (
false
)
gameObjectsthe game objects to consider

Definition at line 335 of file FindDialog.java.

Referenced by net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.doFind().

+ Here is the caller graph for this function:

Member Data Documentation

◆ ACTION_BUILDER

final ActionBuilder net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta")
staticprivate

Action Builder.

Definition at line 78 of file FindDialog.java.

Referenced by net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.display().

◆ dialog

◆ findArchCheckbox

final AbstractButton net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.findArchCheckbox = new JCheckBox(ActionBuilderUtils.getString(ACTION_BUILDER, "findWhereArch"))
private

The checkbox for matching archetype names.

Definition at line 119 of file FindDialog.java.

Referenced by net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.display(), and net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.doFind().

◆ findFaceCheckbox

final AbstractButton net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.findFaceCheckbox = new JCheckBox(ActionBuilderUtils.getString(ACTION_BUILDER, "findWhereFace"))
private

The checkbox for matching 'face' or 'animation' attributes.

Definition at line 131 of file FindDialog.java.

Referenced by net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.display(), and net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.doFind().

◆ findInput

final JTextComponent net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.findInput = new JTextField(20)
private

◆ findMsgCheckbox

final AbstractButton net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.findMsgCheckbox = new JCheckBox(ActionBuilderUtils.getString(ACTION_BUILDER, "findWhereMsg"))
private

The checkbox for matching 'msg' attributes.

Definition at line 125 of file FindDialog.java.

Referenced by net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.display(), and net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.doFind().

◆ findNameCheckbox

final AbstractButton net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.findNameCheckbox = new JCheckBox(ActionBuilderUtils.getString(ACTION_BUILDER, "findWhereName"))
private

The checkbox for matching 'name' attributes.

Definition at line 113 of file FindDialog.java.

Referenced by net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.display(), and net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.doFind().

◆ findOtherCheckbox

final AbstractButton net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.findOtherCheckbox = new JCheckBox(ActionBuilderUtils.getString(ACTION_BUILDER, "findWhereOther"))
private

The checkbox for matching all other attributes.

Definition at line 143 of file FindDialog.java.

Referenced by net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.display(), and net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.doFind().

◆ findSlayingCheckbox

final AbstractButton net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.findSlayingCheckbox = new JCheckBox(ActionBuilderUtils.getString(ACTION_BUILDER, "findWhereSlaying"))
private

The checkbox for matching 'slaying' attributes.

Definition at line 137 of file FindDialog.java.

Referenced by net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.display(), and net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.doFind().

◆ isBuilt

boolean net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isBuilt
private

Whether this find dialog has been displayed.

Definition at line 95 of file FindDialog.java.

Referenced by net.sf.gridarta.gui.dialog.find.FindDialog< G, A, R >.display().

◆ mapView

◆ parent

final Component net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.parent
private

◆ serialVersionUID

final long net.sf.gridarta.gui.dialog.find.FindDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.serialVersionUID = 1L
staticprivate

Serial Version UID.

Definition at line 72 of file FindDialog.java.


The documentation for this class was generated from the following file: