package bhuffake.manta;
import bhuffake.list.MyList;
import java.awt.*;
/***********************************************************************
* DisplayFrame written 10/11/97
* by Bradley Huffaker modified 11/09/97
* Cooperative Association for Internet Data Analysis
* version 1.0
*
* This will allow for the display of small colorbars
* and a string in a Frame.
************************************************************************
************************************************************************
By accessing this software, DISPLAYFRAME, you are duly informed of and
agree to be bound by the conditions described below in this notice:
This software product, DISPLAYFRAME, is developed by Bradley Huffaker, and
copyrighted(C) 1998 by the University of California, San Diego (UCSD),
with all rights reserved. UCSD administers the NLANR Cache grants,
NCR-9796082 and NCR-9616602, under which most of this code was
developed.
There is no charge for DISPLAYFRAME 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. DISPLAYFRAME 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 DISPLAYFRAME
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/NLANR
9500 Gilman Dr., MS-0505
La Jolla, CA 92093 - 0505 USA
Or contact INFO@NLANR.NET
***********************************************************************/
public class DisplayFrame extends Frame
{
private Display display;
private Button Cancel;
//This would not be needed in Java1.1. But is for Java1.0.
private boolean hidden = false;;
private Scrollbar hbar, vbar;
public DisplayFrame(String name)
{
super(name);
display = new Display();
Cancel = new Button("Close");
hbar = new Scrollbar(Scrollbar.HORIZONTAL);
vbar = new Scrollbar(Scrollbar.VERTICAL);
Panel center = new Panel();
center.setLayout(new BorderLayout());
center.add("Center",display);
center.add("East",vbar);
setLayout(new BorderLayout());
add("Center",center);
add("South",Cancel);
pack();
Dimension dim = size();
resize(200,300);
}
public boolean handleEvent(Event event)
{
if (event.id == event.ACTION_EVENT && event.target == Cancel)
this.hide();
if (event.target == hbar)
display.Shift_X( ((Integer)event.arg).intValue()/(float)90 );
if (event.target == vbar)
display.Shift_Y( ((Integer)event.arg).intValue()/(float)90 );
return super.handleEvent(event);
}
public void clear()
{
display.clear();
}
public void add(String string, Color color)
{
Bar bar = new Bar(string, color);
display.add(bar);
}
public void show()
{
hidden = false;
super.show();
}
public void hide()
{
hidden = true;
super.hide();
}
public boolean hidden() { return hidden; }
}
class Bar
{
String name;
Color color;
public Bar(String name_input, Color color_input)
{
name = name_input;
color = color_input;
}
}
class Display extends Panel
{
private final Color TEXTCOLOR = Color.black;
private final Color BGCOLOR = Color.white;
private final int BUFFER= 70;
private int num_bars;
private Bar[] bars;
private String longest_string = "";
private int pad_width;
private int pad_height;
private float x_shift, y_shift;
public Display()
{
setBackground(BGCOLOR);
num_bars = 0;
bars = new Bar[BUFFER];
y_shift = x_shift = 0;
}
public void add(Bar bar)
{
if (num_bars == bars.length)
grow();
if (bar.name.length() > longest_string.length())
longest_string = bar.name;
bars[num_bars] = bar;
num_bars++;
}
public void clear()
{
num_bars = 0;
}
public void Shift_X( float value)
{
x_shift = value;
repaint();
}
public void Shift_Y(float value)
{
y_shift = value;
repaint();
}
public void paint(Graphics g)
{
FontMetrics fm = getFontMetrics(getFont());
pad_width = fm.charWidth('m');
pad_height = fm.getHeight();
Dimension dim = size();
int block_width = fm.stringWidth(longest_string) + 2*pad_width;
int num_across = dim.width/(block_width + (int)(1.5*pad_width));
if (num_across < 1)
num_across = 1;
int x_pixel_shift, x,y;
x_pixel_shift = dim.width - block_width*num_across - pad_width;
if (x_pixel_shift > 0)
x_pixel_shift = 0;
else
x_pixel_shift *= x_shift ;
x_pixel_shift += pad_width;
x = x_pixel_shift;
y = dim.height - (2*pad_height*((num_bars/num_across) +1)) - pad_width;
if (y > 0)
y = 0;
else
y *= y_shift;
y += pad_width;
for (int index=0; index < num_bars; index++)
{
Bar bar = bars[index];
g.setColor(bar.color);
g.fillRect(x,y,pad_width,pad_height);
x += 2*pad_width;
y += pad_height;
g.setColor(TEXTCOLOR);
g.drawString(bar.name,x,y);
if ( (index+1) % num_across == 0)
{
x = x_pixel_shift;
y += pad_height;
}
else
{
x += block_width;
y -= pad_height;
}
}
}
private void grow()
{
Bar[] temp = bars;
bars = new Bar[(int)(temp.length*1.5)];
int start = num_bars;
if (temp.length < start)
start = temp.length;
for (int index =start-1; index >= 0;index--)
bars[index] = temp[index];
num_bars = start;
}
}
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.zjwndz.com.cn
mkpay.net.cn
pubianba.com.cn
www.8xue8.com.cn
kedu.org.cn
yongyula.com.cn
guici1.com.cn
www.houbi2.com.cn
baoke9.com.cn
www.85tattoo.com.cn