public class DefaultFilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements FilterControl<G,A,R>
Control to check if 1) a specific GameObject can be shown (filter out of view part) 2) a specific MapSquare must be highlighted (analysis part) It provides only one filterOut path (and so elements are visible or not, they can't be twice visible or such). It provides 3 highlight paths. each of them can be (dis)enabled. So you can, e.g., highlight walls in a specific color, teleporters in another and monsters in a third. highlight and filterOut filters works all the same. You can activate specific predefined filters or you can provide your own. If several predefined Filters are activated for a path, they are combined in an OR way. For example, if you enable the filterOut path, activate in this path the wall and the floor filters, only walls and floors will be shown.
MAX_HIGHLIGHT
Constructor and Description |
---|
DefaultFilterControl(@NotNull NamedFilter filterList,
@NotNull EditorSettings editorSettings)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addConfigListener(@NotNull FilterConfigListener listener)
Adds a
FilterConfigListener to be notified about changes. |
void |
addFilter(@NotNull java.lang.String name,
@NotNull Filter<?,?> filter) |
boolean |
canShow(G gameObject) |
void |
createMenuEntries(@NotNull javax.swing.JMenu menu) |
boolean |
isHighlightedSquare(@NotNull FilterState filterState,
int path) |
void |
newSquare(@NotNull FilterState filterState) |
void |
objectInSquare(@NotNull FilterState filterState,
G gameObject) |
void |
removeConfigListener(@NotNull FilterConfigListener listener)
Removes a
FilterConfigListener to be notified about changes. |
void |
removeFilter(@NotNull java.lang.String name) |
public DefaultFilterControl(@NotNull @NotNull NamedFilter filterList, @NotNull @NotNull EditorSettings editorSettings)
filterList
- the filter list instance to useeditorSettings
- the global editor seetings instancepublic void addConfigListener(@NotNull @NotNull FilterConfigListener listener)
FilterControl
FilterConfigListener
to be notified about changes.addConfigListener
in interface FilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
listener
- the config listenerpublic void removeConfigListener(@NotNull @NotNull FilterConfigListener listener)
FilterControl
FilterConfigListener
to be notified about changes.removeConfigListener
in interface FilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
listener
- the config listenerpublic void createMenuEntries(@NotNull @NotNull javax.swing.JMenu menu)
createMenuEntries
in interface FilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
public void newSquare(@NotNull @NotNull FilterState filterState)
newSquare
in interface FilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
public boolean isHighlightedSquare(@NotNull @NotNull FilterState filterState, int path)
isHighlightedSquare
in interface FilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
public void objectInSquare(@NotNull @NotNull FilterState filterState, @NotNull G gameObject)
objectInSquare
in interface FilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
public boolean canShow(@NotNull G gameObject)
canShow
in interface FilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
public void addFilter(@NotNull @NotNull java.lang.String name, @NotNull @NotNull Filter<?,?> filter)
addFilter
in interface FilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
public void removeFilter(@NotNull @NotNull java.lang.String name)
removeFilter
in interface FilterControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>