01: /*
02: * CONFIDENTIAL AND PROPRIETARY SOURCE CODE OF
03: * NETSCAPE COMMUNICATIONS CORPORATION
04: *
05: * Copyright (c) 1996 Netscape Communications Corporation.
06: * All Rights Reserved.
07: * Use of this Source Code is subject to the terms of the applicable
08: * license agreement from Netscape Communications Corporation.
09: */
10:
11: package query;
12:
13: import netscape.application.Button;
14: import netscape.application.InternalWindow;
15: import netscape.application.Size;
16:
17: public class ContainerPalette extends InternalWindow {
18: public Button adjBtn;
19: public Button andBtn;
20: public Button orBtn;
21:
22: public ContainerPalette(int x, int y) {
23: setTitle("C");
24:
25: Size btnSize = new Size();
26:
27: andBtn = Button.createCheckButton(graphical.Header.WIDGETHGAP,
28: graphical.Header.WIDGETVGAP, 0, 0);
29: andBtn.setTarget(this );
30: andBtn.setCommand(Messages.OP_AND);
31: andBtn.setTitle(Messages.OP_AND);
32: btnSize.union(andBtn.minSize());
33: addSubview(andBtn);
34:
35: orBtn = Button.createCheckButton(graphical.Header.WIDGETHGAP,
36: andBtn.y() + btnSize.height
37: + graphical.Header.WIDGETVGAP, 0, 0);
38: orBtn.setTarget(this );
39: orBtn.setCommand(Messages.OP_OR);
40: orBtn.setTitle(Messages.OP_OR);
41: btnSize.union(orBtn.minSize());
42: addSubview(orBtn);
43:
44: adjBtn = Button.createCheckButton(graphical.Header.WIDGETHGAP,
45: orBtn.y() + btnSize.height
46: + graphical.Header.WIDGETVGAP, 0, 0);
47: adjBtn.setTarget(this );
48: adjBtn.setCommand(Messages.OP_ADJ);
49: adjBtn.setTitle(Messages.OP_ADJ);
50: btnSize.union(adjBtn.minSize());
51: addSubview(adjBtn);
52:
53: andBtn.sizeTo(btnSize.width, btnSize.height);
54: orBtn.sizeTo(btnSize.width, btnSize.height);
55: adjBtn.sizeTo(btnSize.width, btnSize.height);
56:
57: Size size = windowSizeForContentSize(adjBtn.x()
58: + adjBtn.width() + graphical.Header.WIDGETHGAP, adjBtn
59: .y()
60: + adjBtn.height() + graphical.Header.WIDGETVGAP);
61: setBounds(x, y, size.width, size.height);
62: }
63:
64: public void performCommand(String command, Object arg) {
65: if (Messages.OP_AND.equals(command)) {
66: } else if (Messages.OP_OR.equals(command)) {
67: } else if (Messages.OP_ADJ.equals(command)) {
68: } else {
69: super.performCommand(command, arg);
70: }
71: }
72: }
|