package caida.otter;
import caida.tools.GridPanel;
import java.awt.*;
/************************************************************************
* file:ColorMaskFrame.java class: ColorMaskFrame
* Goal: To allow a interactive method for coloring/masking
* objects by their current value.
*
* version 1.0 beta
* written by Bradley Huffaker (04/17/98)
*
*************************************************************************
*************************************************************************
By accessing this software, COLORMASKFRAME, you are duly informed of and
agree to be bound by the conditions described below in this notice:
This software product, COLORMASKFRAME, is developed by Bradley Huffaker, and
copyrighted(C) 1998 by the University of California, San Diego (UCSD),
with all rights reserved. UCSD administers the NSF grant to CAIDA,
number NCR-9711092, under which this code was developed.
There is no charge for COLORMASKFRAME software. You can redistribute it and/or
modify it under the terms of the GNU General Public License, v. 2 dated
June 1991 which is incorporated by reference herein. COLORMASKFRAME is
distributed WITHOUT ANY WARRANTY, IMPLIED OR EXPRESS, OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE or that the use of
it will not infringe on any third party's intellectual property
rights.
You should have received a copy of the GNU GPL along with the COLORMASKFRAME
program. Copies can also be obtained from
http://www.gnu.org/copyleft/gpl.html or by writing to
University of California, San Diego
SDSC/CAIDA
9500 Gilman Dr., MS-0505
La Jolla, CA 92093 - 0505 USA
Or contact INFO@CAIDA.ORG
***********************************************************************/
public class ColorMaskFrame extends Frame
{
// Used when coloring by spectrum
protected double[] values;
protected int[] count;
protected DList dlist;
protected ValuesGroup group;
// Controlling Buttons/Choices
Choice Process = new Choice();
final String PROCESS_COLOR = "Color objects where values";
final int COLOR = 0;
final String PROCESS_MASK = "Show only objects values";
final int MASK = 1;
final String PROCESS_MASK_ALL = "Hide node's links/paths where ";
final int MASK_ALL = 2;
// Controls if this selects objects
Checkbox SelectRoot = new Checkbox("also select object as root");
Choice Control = new Choice();
final String CONTROL_EQUAL = "=";
final int EQUAL = 0;
final String CONTROL_NOT_EQUAL = "!=";
final int NOT_EQUAL = 1;
final String CONTROL_GREATER_EQUAL = ">=";
final int GREATER_EQUAL = 2;
final String CONTROL_GREATER = ">";
final int GREATER = 3;
final String CONTROL_LESS_EQUAL = "<=";
final int LESS_EQUAL = 4;
final String CONTROL_LESS = "<";
final int LESS = 5;
TextField Status = new TextField();
TextField Value = new TextField();
Button Color_Now = new Button("Color Objects");
Button Close = new Button("Close");
// The colors that it uses
final Color SELECT_COLOR = Color.blue;
final Color DESELECT_COLOR = Color.lightGray;
Component display;
// These will handle all the ioStuff
int status = 0;
public final static int STATUS_REDRAW = 0;
Event event = new Event(this,Event.ACTION_EVENT,null);
// Which type of value to use String or Double
int type;
final int DOUBLE = 0;
final int STRING = 1;
public ColorMaskFrame(Component display_input, DList dlist_input)
{
super("Mask/Color by Value");
display = display_input;
dlist = dlist_input;
Process.addItem(PROCESS_COLOR);
Process.addItem(PROCESS_MASK);
Process.addItem(PROCESS_MASK_ALL);
Control.addItem(CONTROL_EQUAL);
Control.addItem(CONTROL_NOT_EQUAL);
Control.addItem(CONTROL_GREATER_EQUAL);
Control.addItem(CONTROL_GREATER);
Control.addItem(CONTROL_LESS_EQUAL);
Control.addItem(CONTROL_LESS);
Value.setText("0");
GridPanel this_grid = new GridPanel(this);
this_grid.addSize(Process,0,0,2,1);
this_grid.addSize(SelectRoot,0,1,2,1);
this_grid.add(Control,0,2);
this_grid.add(Value,1,2);
this_grid.addSize(Status,0,3,2,1);
this_grid.add(Color_Now,0,4);
this_grid.add(Close,1,4);
pack();
}
public void hide()
{
DList mylist = dlist.DList();
mylist.reset();
while (!mylist.end())
{
DisplayObject object =mylist.next();
object.show();
object.setToDefaultColor();
}
status = STATUS_REDRAW;
display.handleEvent(event);
super.hide();
}
public void Color(ValuesGroup group_input)
{
group = group_input;
if (group == null)
return;
// --- Setting control
int control = EQUAL;
String control_string = Control.getSelectedItem();
if (control_string.equals(CONTROL_LESS_EQUAL))
control = LESS_EQUAL;
else if (control_string.equals(CONTROL_LESS))
control = LESS;
else if (control_string.equals(CONTROL_GREATER_EQUAL))
control = GREATER_EQUAL;
else if (control_string.equals(CONTROL_GREATER))
control = GREATER;
else if (control_string.equals(CONTROL_NOT_EQUAL))
control = NOT_EQUAL;
int process = COLOR;
if (Process.getSelectedItem() == PROCESS_MASK)
process = MASK;
else if (Process.getSelectedItem() == PROCESS_MASK_ALL)
process = MASK_ALL;
if (group.getType() == ValuesGroup.DOUBLE)
type = DOUBLE;
else
type = STRING;
boolean selectRoot = SelectRoot.getState();
double double_value = 0;
String string_value = null;
if (type == DOUBLE)
{
try {
double_value = Double.valueOf(Value.getText())
.doubleValue();
} catch (NumberFormatException exception) {
getToolkit().beep();
Value.setText("");
Status.setText("Must be a double");
System.err.println("ColorByNumber.Color():" +
exception.toString());
return;
}
}
else
string_value = Value.getText();
int num_matchs = 0;
DList mylist = dlist.DList();
mylist.reset();
boolean match = true;
while(!mylist.end())
{
DisplayObject object= mylist.next();
object.show();
if (object.hasValues())
{
double d_value;
String s_value;
if (type == DOUBLE)
{
double value = object.getDouble();
switch (control)
{
case EQUAL:
if (value == double_value)
match = true;
else
match = false;
break;
case NOT_EQUAL:
if (value != double_value)
match = true;
else
match = false;
break;
case GREATER:
if (value > double_value)
match = true;
else
match = false;
break;
case GREATER_EQUAL:
if (value >= double_value)
match = true;
else
match = false;
break;
case LESS:
if (value < double_value)
match = true;
else
match = false;
break;
case LESS_EQUAL:
if (value <= double_value)
match = true;
else
match = false;
}
}
else
{
String value = object.getString();
if (value.indexOf(string_value) >= 0)
match = true;
else
match = false;
if (control == NOT_EQUAL)
match = !match;
}
if (selectRoot && object instanceof Node)
((Node)object).setRoot(match);
if (match)
{
num_matchs++;
object.setColor(SELECT_COLOR);
if (process == MASK)
object.show();
else if (process != COLOR)
object.hideAll();
}
else
{
object.setColor(DESELECT_COLOR);
if (process == MASK)
object.hide();
else if (process != COLOR)
object.showAll();
}
}
else
object.setToDefaultColor();
}
if (process == MASK_ALL)
{
mylist.reset();
while (!mylist.end())
{
DisplayObject object = mylist.next();
if (object instanceof Node)
((Node)object).hideIfLinksHide();
}
}
Status.setText("Match: " +num_matchs);
status = STATUS_REDRAW;
display.handleEvent(event);
}
public boolean handleEvent(Event event)
{
switch (event.id)
{
case Event.ACTION_EVENT:
{
if (event.target == Close)
{
hide();
}
else
{
Color(group);
}
break;
}
}
return super.handleEvent(event);
}
}
There was peace and harmony in the home of the Reverend Taylor. An air of neatness and prosperity was about his four-room adobe house. The mocking-bird that hung in a willow cage against the white wall, by the door, whistled sweet mimicry of the cheep of the little chickens in the back yard, and hopped to and fro and up and down on his perches, pecking at the red chili between the bars. From the corner of his eyes he could peek into the window, and it was bright with potted geraniums, white as the wall, or red as the chili, or pink as the little crumpled palm that patted against the glass to him. It was the first scene of the closing act of the tragic comedy of the Geronimo campaign. That wily old devil, weary temporarily of the bloodshed he had continued with more or less regularity for many years, had[Pg 297] sent word to the officers that he would meet them without their commands, in the Ca?on de los Embudos, across the border line, to discuss the terms of surrender. The officers had forthwith come, Crook yet hopeful that something might be accomplished by honesty and plain dealing; the others, for the most part, doubting. The two rival Ministers of England became every day more embittered against each other; and Bolingbroke grew more daring in his advances towards the Pretender, and towards measures only befitting a Stuart's reign. In order to please the High Church, whilst he was taking the surest measures to ruin it by introducing a popish prince, he consulted with Atterbury, and they agreed to bring in a Bill which should prevent Dissenters from educating their own children. This measure was sure to please the Hanoverian Tories, who were as averse from the Dissenters as the Whigs. Thus it would conciliate them and obtain their support at the[19] very moment that the chief authors of it were planning the ruin of their party. This Bill was called the Schism Bill, and enjoined that no person in Great Britain should keep any school, or act as tutor, who had not first subscribed the declaration to conform to the Church of England, and obtained a licence of the diocesan. Upon failure of so doing, the party might be committed to prison without bail; and no such licence was to be granted before the party produced a certificate of his having received the Sacrament according to the communion of the English Church within the last year, and of his having also subscribed the oaths of Allegiance and Supremacy. The earliest martial event of the year 1760 was the landing of Thurot, the French admiral, at Carrickfergus, on the 28th of February. He had been beating about between Scandinavia and Ireland till he had only three ships left, and but six hundred soldiers. But Carrickfergus being negligently garrisoned, Thurot made his way into the town and plundered it, but was soon obliged to abandon it. He was overtaken by Captain Elliot and three frigates before he had got out to sea, his ships were taken, he himself was killed, and his men were carried prisoners to Ramsey, in the Isle of Man. "I see you've got a cow here," said a large man wearing a dingy blue coat with a Captain's faded shoulder-straps. "I'm a Commissary, and it's my duty to take her." Suddenly they heard little Pete's voice calling: "Stop your ranting and tell me how the hogs got you." "Hold, Lord de Boteler," interrupted Father John, calmly; "the threat need not pass thy lips: I go; but before I depart I shall say, in spite of mortal tongue or mortal hand, that honor and true knighthood no longer preside in this hall, where four generations upheld them unsullied." HoME小明看看台湾视频发布
ENTER NUMBET 0017
www.utime.net.cn
www.daire4.net.cn
www.zgwlbwg.com.cn
junan7.net.cn
yubei5.net.cn
shimi9.com.cn
73j77.net.cn
abcwallet.com.cn
www.5176.net.cn
10webfind.com.cn