tesseract
4.00.00dev
SVCheckboxMenuItem.java
Go to the documentation of this file.
1
// Copyright 2007 Google Inc. All Rights Reserved.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License"); You may not
4
// use this file except in compliance with the License. You may obtain a copy of
5
// the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
6
// applicable law or agreed to in writing, software distributed under the
7
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
8
// OF ANY KIND, either express or implied. See the License for the specific
9
// language governing permissions and limitations under the License.
10
11
package
com.google.scrollview.ui;
12
22
import
com
.
google
.
scrollview
.
ScrollView
;
23
import
com
.
google
.
scrollview
.
events
.
SVEvent
;
24
import
com
.
google
.
scrollview
.
events
.
SVEventType
;
25
26
import
javax.swing.JCheckBoxMenuItem;
27
31
class
SVCheckboxMenuItem
extends
SVAbstractMenuItem {
32
public
String value = null;
33
public
String desc = null;
34
public
boolean
bvalue;
35
36
SVCheckboxMenuItem(
int
id
, String name,
boolean
val) {
37
super(
id
, name,
new
JCheckBoxMenuItem(name, val));
38
bvalue = val;
39
}
40
42
@Override
43
public
void
performAction(SVWindow window,
SVEventType
eventType) {
44
// Checkbox entry - trigger and send event.
45
if
(bvalue) {
46
bvalue =
false
;
47
}
else
{
48
bvalue =
true
;
49
}
50
SVEvent
svme =
new
SVEvent
(eventType, window,
id
, getValue());
51
ScrollView
.addMessage(svme);
52
}
53
55
@Override
56
public
String getValue() {
57
return
Boolean.toString(bvalue);
58
}
59
}
60
SVEvent
Definition:
scrollview.h:61
com.google.scrollview.events
Definition:
SVEvent.java:11
com.google.scrollview
com.google.scrollview.events.SVEventType
Definition:
SVEventType.java:20
SVEventType
SVEventType
Definition:
scrollview.h:45
com.google
com.google.scrollview.ScrollView
Definition:
ScrollView.java:32
com.google.scrollview.events.SVEvent
Definition:
SVEvent.java:21
ScrollView
Definition:
scrollview.h:102
com
java
com
google
scrollview
ui
SVCheckboxMenuItem.java
Generated on Sat May 20 2017 21:28:59 for tesseract by
1.8.13