Gridarta Editor
GoMapListModel.java
Go to the documentation of this file.
1
/*
2
* Gridarta MMORPG map editor for Crossfire, Daimonin and similar games.
3
* Copyright (C) 2000-2021 The Gridarta Developers.
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License along
16
* with this program; if not, write to the Free Software Foundation, Inc.,
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
*/
19
20
package
net.sf.gridarta.gui.dialog.gomap;
21
22
import
javax.swing.DefaultListModel;
23
import
net
.
sf
.
gridarta
.
model
.
mapmodel
.
MapFile
;
24
29
public
class
GoMapListModel
extends
DefaultListModel<MapFile> {
30
34
private
static
final
long
serialVersionUID
= 1L;
35
39
private
boolean
enabled
=
true
;
40
45
private
int
index0
;
46
51
private
int
index1
;
52
53
@Override
54
protected
void
fireIntervalAdded
(
final
Object source,
final
int
index0
,
final
int
index1
) {
55
if
(!
enabled
) {
56
if
(
index0
< this.index0) {
57
this.index0 =
index0
;
58
}
59
if
(
index1
> this.index1) {
60
this.index1 =
index1
;
61
}
62
return
;
63
}
64
65
super.fireIntervalAdded(source,
index0
,
index1
);
66
}
67
72
public
void
enable
(
final
boolean
enabled
) {
73
if
(this.enabled ==
enabled
) {
74
return
;
75
}
76
77
this.enabled =
enabled
;
78
if
(!
enabled
) {
79
index0
= Integer.MAX_VALUE;
80
index1
= Integer.MIN_VALUE;
81
}
else
if
(
index0
<=
index1
) {
82
super.fireIntervalAdded(
this
,
index0
,
index1
);
83
}
84
}
85
86
}
net.sf.gridarta.gui.dialog.gomap.GoMapListModel.index1
int index1
Definition:
GoMapListModel.java:51
net.sf.gridarta
net.sf
net.sf.gridarta.model.mapmodel
Definition:
AboveFloorInsertionMode.java:20
net
net.sf.gridarta.gui.dialog.gomap.GoMapListModel.fireIntervalAdded
void fireIntervalAdded(final Object source, final int index0, final int index1)
Definition:
GoMapListModel.java:54
net.sf.gridarta.gui.dialog.gomap.GoMapListModel.index0
int index0
Definition:
GoMapListModel.java:45
net.sf.gridarta.gui.dialog.gomap.GoMapListModel.serialVersionUID
static final long serialVersionUID
Definition:
GoMapListModel.java:34
net.sf.gridarta.model.mapmodel.MapFile
Definition:
MapFile.java:31
net.sf.gridarta.gui.dialog.gomap.GoMapListModel.enable
void enable(final boolean enabled)
Definition:
GoMapListModel.java:72
net.sf.gridarta.model
net.sf.gridarta.gui.dialog.gomap.GoMapListModel.enabled
boolean enabled
Definition:
GoMapListModel.java:39
net.sf.gridarta.gui.dialog.gomap.GoMapListModel
Definition:
GoMapListModel.java:29
src
gridarta
src
main
java
net
sf
gridarta
gui
dialog
gomap
GoMapListModel.java
Generated by
1.8.17