Initial
BIN
java/HOTLINK/ANIMAT~1.CLA
Normal file
202
java/HOTLINK/HOTLINK.MAK
Normal file
@@ -0,0 +1,202 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Format Version 4.20
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Java Virtual Machine Java Workspace" 0x0809
|
||||
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=hotlink - Java Virtual Machine Debug
|
||||
!MESSAGE No configuration specified. Defaulting to hotlink - Java Virtual\
|
||||
Machine Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "hotlink - Java Virtual Machine Release" && "$(CFG)" !=\
|
||||
"hotlink - Java Virtual Machine Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE on this makefile
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Hotlink.mak" CFG="hotlink - Java Virtual Machine Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "hotlink - Java Virtual Machine Release" (based on\
|
||||
"Java Virtual Machine Java Workspace")
|
||||
!MESSAGE "hotlink - Java Virtual Machine Debug" (based on\
|
||||
"Java Virtual Machine Java Workspace")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
################################################################################
|
||||
# Begin Project
|
||||
# PROP Target_Last_Scanned "hotlink - Java Virtual Machine Debug"
|
||||
JAVA=jvc.exe
|
||||
|
||||
!IF "$(CFG)" == "hotlink - Java Virtual Machine Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir ""
|
||||
# PROP BASE Intermediate_Dir ""
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir ""
|
||||
# PROP Intermediate_Dir ""
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.
|
||||
INTDIR=.
|
||||
|
||||
ALL : "$(OUTDIR)\InFile.class" "$(OUTDIR)\LocalServer.class"\
|
||||
"$(OUTDIR)\HotLink.class" "$(OUTDIR)\OutFile.class"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\HotLink.class"
|
||||
-@erase "$(INTDIR)\InFile.class"
|
||||
-@erase "$(INTDIR)\LocalServer.class"
|
||||
-@erase "$(INTDIR)\OutFile.class"
|
||||
|
||||
# ADD BASE JAVA /O
|
||||
# ADD JAVA /O
|
||||
|
||||
!ELSEIF "$(CFG)" == "hotlink - Java Virtual Machine Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir ""
|
||||
# PROP BASE Intermediate_Dir ""
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir ""
|
||||
# PROP Intermediate_Dir ""
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.
|
||||
INTDIR=.
|
||||
|
||||
ALL : "$(OUTDIR)\InFile.class" "$(OUTDIR)\LocalServer.class"\
|
||||
"$(OUTDIR)\HotLink.class" "$(OUTDIR)\OutFile.class"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\HotLink.class"
|
||||
-@erase "$(INTDIR)\InFile.class"
|
||||
-@erase "$(INTDIR)\LocalServer.class"
|
||||
-@erase "$(INTDIR)\OutFile.class"
|
||||
|
||||
# ADD BASE JAVA /g
|
||||
# ADD JAVA /g
|
||||
|
||||
!ENDIF
|
||||
|
||||
################################################################################
|
||||
# Begin Target
|
||||
|
||||
# Name "hotlink - Java Virtual Machine Release"
|
||||
# Name "hotlink - Java Virtual Machine Debug"
|
||||
|
||||
!IF "$(CFG)" == "hotlink - Java Virtual Machine Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "hotlink - Java Virtual Machine Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\InFile.java
|
||||
|
||||
!IF "$(CFG)" == "hotlink - Java Virtual Machine Release"
|
||||
|
||||
|
||||
"$(INTDIR)\InFile.class" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "hotlink - Java Virtual Machine Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\InFile.class" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\hotlink.html
|
||||
|
||||
!IF "$(CFG)" == "hotlink - Java Virtual Machine Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "hotlink - Java Virtual Machine Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LocalServer.java
|
||||
|
||||
!IF "$(CFG)" == "hotlink - Java Virtual Machine Release"
|
||||
|
||||
|
||||
"$(INTDIR)\LocalServer.class" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "hotlink - Java Virtual Machine Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\LocalServer.class" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\HotLink.java
|
||||
|
||||
!IF "$(CFG)" == "hotlink - Java Virtual Machine Release"
|
||||
|
||||
|
||||
"$(INTDIR)\HotLink.class" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "hotlink - Java Virtual Machine Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\HotLink.class" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\OutFile.java
|
||||
|
||||
!IF "$(CFG)" == "hotlink - Java Virtual Machine Release"
|
||||
|
||||
|
||||
"$(INTDIR)\OutFile.class" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "hotlink - Java Virtual Machine Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\OutFile.class" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
################################################################################
|
||||
BIN
java/HOTLINK/HOTLIN~1.CLA
Normal file
16
java/HOTLINK/HOTLIN~1.HTM
Normal file
@@ -0,0 +1,16 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>proto</title>
|
||||
</head>
|
||||
<body>
|
||||
<hr>
|
||||
<applet
|
||||
code=HotLink.class
|
||||
id=proto
|
||||
width=640
|
||||
height=480 >
|
||||
</applet>
|
||||
<hr>
|
||||
<a href="HotLink.java">The source.</a>
|
||||
</body>
|
||||
</html>
|
||||
141
java/HOTLINK/HOTLIN~1.JAV
Normal file
@@ -0,0 +1,141 @@
|
||||
import java.awt.*;
|
||||
import java.awt.Font;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Color;
|
||||
import java.util.Date;
|
||||
import java.awt.Frame;
|
||||
import java.awt.image.*;
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
|
||||
public class HotLink extends java.applet.Applet implements Runnable
|
||||
{
|
||||
private Thread mThread;
|
||||
private final int smImageCount=12;
|
||||
private Image[] mLedImages=new Image[smImageCount];
|
||||
private String mStrServerIP;
|
||||
// private String mURLString;
|
||||
private Button mHTTPButton;
|
||||
private Button mTelnetButton;
|
||||
private final int mTimeout=60000;
|
||||
private final String mHTTPButtonLabel=new String("Ganymede (HTTP)");
|
||||
private final String mTelnetButtonLabel=new String("Ganymede (TELNET)");
|
||||
|
||||
public HotLink()
|
||||
{
|
||||
}
|
||||
public void init()
|
||||
{
|
||||
mHTTPButton=new Button(mHTTPButtonLabel);
|
||||
mTelnetButton=new Button(mTelnetButtonLabel);
|
||||
add(mHTTPButton);
|
||||
add(mTelnetButton);
|
||||
mLedImages[0]=getImage(getCodeBase(),"image/zero.gif");
|
||||
mLedImages[1]=getImage(getCodeBase(),"image/one.gif");
|
||||
mLedImages[2]=getImage(getCodeBase(),"image/two.gif");
|
||||
mLedImages[3]=getImage(getCodeBase(),"image/three.gif");
|
||||
mLedImages[4]=getImage(getCodeBase(),"image/four.gif");
|
||||
mLedImages[5]=getImage(getCodeBase(),"image/five.gif");
|
||||
mLedImages[6]=getImage(getCodeBase(),"image/six.gif");
|
||||
mLedImages[7]=getImage(getCodeBase(),"image/seven.gif");
|
||||
mLedImages[8]=getImage(getCodeBase(),"image/eight.gif");
|
||||
mLedImages[9]=getImage(getCodeBase(),"image/nine.gif");
|
||||
mLedImages[10]=getImage(getCodeBase(),"image/dash.gif");
|
||||
mLedImages[11]=getImage(getCodeBase(),"image/blank.gif");
|
||||
MediaTracker mediaTracker=new MediaTracker(this);
|
||||
for(int imageIndex=0;imageIndex<smImageCount;imageIndex++)mediaTracker.addImage(mLedImages[imageIndex],imageIndex);
|
||||
try(mediaTracker.waitForAll());
|
||||
catch(InterruptedException exception){;}
|
||||
repaint();
|
||||
}
|
||||
public void run()
|
||||
{
|
||||
while(null!=mThread)
|
||||
{
|
||||
LocalServer localServer;
|
||||
localServer=new LocalServer();
|
||||
try{mStrServerIP=localServer.getServerIP(getCodeBase());}
|
||||
catch(Exception exception){mStrServerIP=new String("255.255.255.255");}
|
||||
// mURLString=new String("http://");
|
||||
// mURLString+=mStrServerIP;
|
||||
repaint();
|
||||
try{mThread.sleep(mTimeout);}
|
||||
catch(InterruptedException exception){break;}
|
||||
}
|
||||
}
|
||||
public void start()
|
||||
{
|
||||
if(mThread==null){mThread=new Thread(this);mThread.start();}
|
||||
}
|
||||
public void stop()
|
||||
{
|
||||
if(null!=mThread){mThread.stop();mThread=null;}
|
||||
}
|
||||
public void update(Graphics graphics)
|
||||
{
|
||||
paint(graphics);
|
||||
}
|
||||
public void paint(Graphics graphics)
|
||||
{
|
||||
setBackground(new Color(0x2A,0x7F,0xAA));
|
||||
drawLEDString(mStrServerIP,graphics);
|
||||
}
|
||||
public void drawLEDString(String strLED,Graphics graphics)
|
||||
{
|
||||
int strLength=strLED.length();
|
||||
int imageWidth;
|
||||
int imageHeight;
|
||||
Point ptLoc;
|
||||
|
||||
ptLoc=new Point(4,4);
|
||||
imageWidth=mLedImages[0].getWidth(this);
|
||||
imageHeight=mLedImages[0].getHeight(this);
|
||||
for(int strIndex=0;strIndex<strLength;strIndex++)
|
||||
{
|
||||
char strChar=strLED.charAt(strIndex);
|
||||
|
||||
if('0'==strChar)graphics.drawImage(mLedImages[0],ptLoc.x,ptLoc.y,this);
|
||||
else if('1'==strChar)graphics.drawImage(mLedImages[1],ptLoc.x,ptLoc.y,this);
|
||||
else if('2'==strChar)graphics.drawImage(mLedImages[2],ptLoc.x,ptLoc.y,this);
|
||||
else if('3'==strChar)graphics.drawImage(mLedImages[3],ptLoc.x,ptLoc.y,this);
|
||||
else if('4'==strChar)graphics.drawImage(mLedImages[4],ptLoc.x,ptLoc.y,this);
|
||||
else if('5'==strChar)graphics.drawImage(mLedImages[5],ptLoc.x,ptLoc.y,this);
|
||||
else if('6'==strChar)graphics.drawImage(mLedImages[6],ptLoc.x,ptLoc.y,this);
|
||||
else if('7'==strChar)graphics.drawImage(mLedImages[7],ptLoc.x,ptLoc.y,this);
|
||||
else if('8'==strChar)graphics.drawImage(mLedImages[8],ptLoc.x,ptLoc.y,this);
|
||||
else if('9'==strChar)graphics.drawImage(mLedImages[9],ptLoc.x,ptLoc.y,this);
|
||||
else if('.'==strChar)graphics.drawImage(mLedImages[10],ptLoc.x,ptLoc.y,this);
|
||||
else graphics.drawImage(mLedImages[11],ptLoc.x,ptLoc.y,this);
|
||||
ptLoc.x+=imageWidth;
|
||||
}
|
||||
graphics.setColor(new Color(48,64,0));
|
||||
graphics.drawLine(3,3,ptLoc.x,3);
|
||||
graphics.drawLine(3,3,3,imageHeight+4);
|
||||
graphics.setColor(new Color(175,192,224));
|
||||
graphics.drawLine(3,imageHeight+4,ptLoc.x,imageHeight+4);
|
||||
graphics.drawLine(ptLoc.x,3,ptLoc.x,imageHeight+4);
|
||||
graphics.setColor(new Color(96,143,208));
|
||||
graphics.drawRect(2,2,(ptLoc.x+1)-2,imageHeight+3);
|
||||
graphics.setColor(new Color(175,192,224));
|
||||
graphics.drawLine(1,1,ptLoc.x+2,1);
|
||||
}
|
||||
public boolean action(Event event,Object object)
|
||||
{
|
||||
if(null!=mHTTPButton&&mHTTPButton==event.target)
|
||||
{
|
||||
URL localLink;
|
||||
try{localLink=new URL("http://"+mStrServerIP);};
|
||||
catch(MalformedURLException exception){return true;}
|
||||
getAppletContext().showDocument(localLink);
|
||||
}
|
||||
else if(null!=mTelnetButton&&mTelnetButton==event.target)
|
||||
{
|
||||
URL localLink;
|
||||
try{localLink=new URL("telnet:"+mStrServerIP);}
|
||||
catch(MalformedURLException exception){return true;}
|
||||
getAppletContext().showDocument(localLink);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
BIN
java/HOTLINK/Hotlink.mdp
Normal file
BIN
java/HOTLINK/IMAGE/BLANK.GIF
Normal file
|
After Width: | Height: | Size: 126 B |
BIN
java/HOTLINK/IMAGE/DASH.GIF
Normal file
|
After Width: | Height: | Size: 130 B |
BIN
java/HOTLINK/IMAGE/EIGHT.GIF
Normal file
|
After Width: | Height: | Size: 133 B |
BIN
java/HOTLINK/IMAGE/FIVE.GIF
Normal file
|
After Width: | Height: | Size: 138 B |
BIN
java/HOTLINK/IMAGE/FOUR.GIF
Normal file
|
After Width: | Height: | Size: 138 B |
BIN
java/HOTLINK/IMAGE/LED.GIF
Normal file
|
After Width: | Height: | Size: 631 B |
BIN
java/HOTLINK/IMAGE/NINE.GIF
Normal file
|
After Width: | Height: | Size: 139 B |
BIN
java/HOTLINK/IMAGE/ONE.GIF
Normal file
|
After Width: | Height: | Size: 137 B |
BIN
java/HOTLINK/IMAGE/SEVEN.GIF
Normal file
|
After Width: | Height: | Size: 137 B |
BIN
java/HOTLINK/IMAGE/SIX.GIF
Normal file
|
After Width: | Height: | Size: 137 B |
BIN
java/HOTLINK/IMAGE/THREE.GIF
Normal file
|
After Width: | Height: | Size: 138 B |
BIN
java/HOTLINK/IMAGE/TWO.GIF
Normal file
|
After Width: | Height: | Size: 139 B |
BIN
java/HOTLINK/IMAGE/ZERO.GIF
Normal file
|
After Width: | Height: | Size: 137 B |
BIN
java/HOTLINK/INFILE~1.CLA
Normal file
69
java/HOTLINK/INFILE~1.JAV
Normal file
@@ -0,0 +1,69 @@
|
||||
import java.net.*;
|
||||
import java.io.*;
|
||||
|
||||
class InFile
|
||||
{
|
||||
boolean mIsOkay;
|
||||
private URL mInFile;
|
||||
private URLConnection mConnection;
|
||||
private DataInputStream mInData;
|
||||
private String mStrLine;
|
||||
|
||||
public InFile()
|
||||
{
|
||||
mIsOkay=false;
|
||||
}
|
||||
public InFile(URL resBase,String strHostPathFileName)throws Exception
|
||||
{
|
||||
open(resBase,strHostPathFileName);
|
||||
}
|
||||
public void open(URL resBase,String strHostPathFileName)throws Exception
|
||||
{
|
||||
close();
|
||||
try{mInFile=new URL(resBase,strHostPathFileName);}
|
||||
catch(Exception exception){throw new Exception();}
|
||||
try{mConnection=mInFile.openConnection();}
|
||||
catch(Exception exception){throw new Exception();}
|
||||
try{mInData=new DataInputStream(mConnection.getInputStream());}
|
||||
catch(Exception exception){throw new Exception();}
|
||||
mIsOkay=true;
|
||||
}
|
||||
public void close()
|
||||
{
|
||||
if(!isOkay())return;
|
||||
try{mInData.close();}
|
||||
catch(Exception exception){;}
|
||||
mIsOkay=false;
|
||||
}
|
||||
public String readLine()throws Exception
|
||||
{
|
||||
if(!isOkay())throw new Exception();
|
||||
try{mStrLine=new String(mInData.readLine());}
|
||||
catch(Exception exception){throw new Exception();}
|
||||
return mStrLine;
|
||||
}
|
||||
public boolean isOkay()
|
||||
{
|
||||
return mIsOkay;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* URL inFile;
|
||||
URLConnection connection;
|
||||
DataInputStream inData;
|
||||
String strLine;
|
||||
|
||||
try{inFile=new URL(getCodeBase(),"ip");}
|
||||
catch(Exception exception){mStrString=new String("Error creating URL");showStatus(mStrString);repaint();return;}
|
||||
try{connection=inFile.openConnection();}
|
||||
catch(Exception exception){mStrString=new String("Error in URL connection.");showStatus(mStrString);repaint();return;}
|
||||
connection.setUseCaches(false);
|
||||
try{inData=new DataInputStream(connection.getInputStream());}
|
||||
catch(Exception exception){mStrString=new String("Error getting input stream.");showStatus(mStrString);repaint();return;}
|
||||
try{strLine=new String(inData.readLine());inData.close();}
|
||||
catch(Exception exception){mStrString=new String("Error reading data input stream.");showStatus(mStrString);repaint();return;}
|
||||
mStrString=new String(strLine);
|
||||
repaint();
|
||||
*/
|
||||
BIN
java/HOTLINK/INFILE~2.CLA
Normal file
4
java/HOTLINK/IP
Normal file
@@ -0,0 +1,4 @@
|
||||
line 1
|
||||
line 2
|
||||
[HOST] listcuser21.li.net
|
||||
[IP] 199.208.81.37.
|
||||
BIN
java/HOTLINK/IPLED~1.CLA
Normal file
102
java/HOTLINK/IPLED~1.JAV
Normal file
@@ -0,0 +1,102 @@
|
||||
import java.awt.*;
|
||||
import java.awt.Font;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Color;
|
||||
import java.util.Date;
|
||||
import java.awt.Frame;
|
||||
import java.awt.image.*;
|
||||
|
||||
public class IPLed // extends java.applet.Applet implements Runnable
|
||||
{
|
||||
Thread mThread;
|
||||
final int smImageCount=12;
|
||||
Image[] mLedImages=new Image[smImageCount];
|
||||
String mStrParam;
|
||||
ImageObserver mImageObserver;
|
||||
Button mButton;
|
||||
|
||||
public IPLed(ImageObserver imageObserver,Applet parentApplet)
|
||||
{
|
||||
mImageObserver=new ImageObserver(imageObserver);
|
||||
mParentApplet=new Applet(parentApplet);
|
||||
}
|
||||
|
||||
public void init()
|
||||
{
|
||||
mLedImages[0]=getImage(getCodeBase(),"image/zero.gif");
|
||||
mLedImages[1]=getImage(getCodeBase(),"image/one.gif");
|
||||
mLedImages[2]=getImage(getCodeBase(),"image/two.gif");
|
||||
mLedImages[3]=getImage(getCodeBase(),"image/three.gif");
|
||||
mLedImages[4]=getImage(getCodeBase(),"image/four.gif");
|
||||
mLedImages[5]=getImage(getCodeBase(),"image/five.gif");
|
||||
mLedImages[6]=getImage(getCodeBase(),"image/six.gif");
|
||||
mLedImages[7]=getImage(getCodeBase(),"image/seven.gif");
|
||||
mLedImages[8]=getImage(getCodeBase(),"image/eight.gif");
|
||||
mLedImages[9]=getImage(getCodeBase(),"image/nine.gif");
|
||||
mLedImages[10]=getImage(getCodeBase(),"image/dash.gif");
|
||||
mLedImages[11]=getImage(getCodeBase(),"image/blank.gif");
|
||||
mStrParam=new String(getParameter("address"));
|
||||
if(null==mStrParam)mStrParam="255.255.255.255";
|
||||
MediaTracker mediaTracker=new MediaTracker(mImageObserver);
|
||||
for(int imageIndex=0;imageIndex<smImageCount;imageIndex++)mediaTracker.addImage(mLedImages[imageIndex],imageIndex);
|
||||
try(mediaTracker.waitForAll());
|
||||
catch(InterruptedException ie){;}
|
||||
repaint();
|
||||
}
|
||||
public void run()
|
||||
{
|
||||
// repaint();
|
||||
}
|
||||
public void start()
|
||||
{
|
||||
// if(mThread==null){mThread=new Thread(mImageObserver);mThread.start();}
|
||||
}
|
||||
public void stop()
|
||||
{
|
||||
// if(null!=mThread){mThread.stop();mThread=null;}
|
||||
}
|
||||
public void paint(Graphics graphics)
|
||||
{
|
||||
drawLEDString(mStrParam,graphics);
|
||||
}
|
||||
public void drawLEDString(String strLED,Graphics graphics)
|
||||
{
|
||||
int strLength=strLED.length();
|
||||
int imageWidth;
|
||||
int imageHeight;
|
||||
Point ptLoc;
|
||||
|
||||
ptLoc=new Point(4,4);
|
||||
imageWidth=mLedImages[0].getWidth(mImageObserver);
|
||||
imageHeight=mLedImages[0].getHeight(mImageObserver);
|
||||
for(int strIndex=0;strIndex<strLength;strIndex++)
|
||||
{
|
||||
char strChar=strLED.charAt(strIndex);
|
||||
|
||||
if('0'==strChar)graphics.drawImage(mLedImages[0],ptLoc.x,ptLoc.y,mImageObserver);
|
||||
else if('1'==strChar)graphics.drawImage(mLedImages[1],ptLoc.x,ptLoc.y,mImageObserver);
|
||||
else if('2'==strChar)graphics.drawImage(mLedImages[2],ptLoc.x,ptLoc.y,mImageObserver);
|
||||
else if('3'==strChar)graphics.drawImage(mLedImages[3],ptLoc.x,ptLoc.y,mImageObserver);
|
||||
else if('4'==strChar)graphics.drawImage(mLedImages[4],ptLoc.x,ptLoc.y,mImageObserver);
|
||||
else if('5'==strChar)graphics.drawImage(mLedImages[5],ptLoc.x,ptLoc.y,mImageObserver);
|
||||
else if('6'==strChar)graphics.drawImage(mLedImages[6],ptLoc.x,ptLoc.y,mImageObserver);
|
||||
else if('7'==strChar)graphics.drawImage(mLedImages[7],ptLoc.x,ptLoc.y,mImageObserver);
|
||||
else if('8'==strChar)graphics.drawImage(mLedImages[8],ptLoc.x,ptLoc.y,mImageObserver);
|
||||
else if('9'==strChar)graphics.drawImage(mLedImages[9],ptLoc.x,ptLoc.y,mImageObserver);
|
||||
else if('.'==strChar)graphics.drawImage(mLedImages[10],ptLoc.x,ptLoc.y,mImageObserver);
|
||||
else graphics.drawImage(mLedImages[11],ptLoc.x,ptLoc.y,mImageObserver);
|
||||
ptLoc.x+=imageWidth;
|
||||
}
|
||||
graphics.setColor(new Color(48,64,0));
|
||||
graphics.drawLine(3,3,ptLoc.x,3);
|
||||
graphics.drawLine(3,3,3,imageHeight+4);
|
||||
graphics.setColor(new Color(175,192,224));
|
||||
graphics.drawLine(3,imageHeight+4,ptLoc.x,imageHeight+4);
|
||||
graphics.drawLine(ptLoc.x,3,ptLoc.x,imageHeight+4);
|
||||
graphics.setColor(new Color(96,143,208));
|
||||
graphics.drawRect(2,2,(ptLoc.x+1)-2,imageHeight+3);
|
||||
graphics.setColor(new Color(175,192,224));
|
||||
graphics.drawLine(1,1,ptLoc.x+2,1);
|
||||
}
|
||||
}
|
||||
|
||||
75
java/HOTLINK/Infile~2.jav
Normal file
@@ -0,0 +1,75 @@
|
||||
import java.net.*;
|
||||
import java.io.*;
|
||||
|
||||
class InFile
|
||||
{
|
||||
private boolean mIsOkay;
|
||||
private URL mInFile;
|
||||
private URLConnection mConnection;
|
||||
private DataInputStream mInData;
|
||||
private String mStrLine;
|
||||
|
||||
public InFile()
|
||||
{
|
||||
mIsOkay=false;
|
||||
}
|
||||
public InFile(URL resBase,String strHostPathFileName)throws Exception
|
||||
{
|
||||
mIsOkay=false;
|
||||
open(resBase,strHostPathFileName);
|
||||
}
|
||||
public InFile(String strHostPathFileName)throws Exception
|
||||
{
|
||||
mIsOkay=false;
|
||||
open(strHostPathFileName);
|
||||
}
|
||||
public InFile(String resBase,String strHostPathFileName)throws Exception
|
||||
{
|
||||
mIsOkay=false;
|
||||
open(resBase,strHostPathFileName);
|
||||
}
|
||||
public void open(URL resBase,String strHostPathFileName)throws Exception
|
||||
{
|
||||
close();
|
||||
try{mInFile=new URL(resBase,strHostPathFileName);}
|
||||
catch(MalformedURLException exception){throw new Exception();}
|
||||
try{mConnection=mInFile.openConnection();}
|
||||
catch(Exception exception){throw new Exception();}
|
||||
try{mInData=new DataInputStream(mConnection.getInputStream());}
|
||||
catch(Exception exception){throw new Exception();}
|
||||
mIsOkay=true;
|
||||
}
|
||||
public void open(String resBase,String strHostPathFileName)throws Exception
|
||||
{
|
||||
open(resBase+strHostPathFileName);
|
||||
}
|
||||
public void open(String strHostPathFileName)throws Exception
|
||||
{
|
||||
close();
|
||||
try{mInFile=new URL(strHostPathFileName);}
|
||||
catch(MalformedURLException exception){throw new Exception();}
|
||||
try{mConnection=mInFile.openConnection();}
|
||||
catch(IOException ioException){throw new Exception();}
|
||||
try{mInData=new DataInputStream(mConnection.getInputStream());}
|
||||
catch(Exception exception){throw new Exception();}
|
||||
mIsOkay=true;
|
||||
}
|
||||
public void close()
|
||||
{
|
||||
if(!isOkay())return;
|
||||
try{mInData.close();}
|
||||
catch(Exception exception){;}
|
||||
mIsOkay=false;
|
||||
}
|
||||
public String readLine()throws Exception
|
||||
{
|
||||
if(!isOkay())throw new Exception();
|
||||
try{mStrLine=new String(mInData.readLine());}
|
||||
catch(IOException ioException){throw new Exception();}
|
||||
return mStrLine;
|
||||
}
|
||||
public boolean isOkay()
|
||||
{
|
||||
return mIsOkay;
|
||||
}
|
||||
};
|
||||
BIN
java/HOTLINK/LOCALL~1.CLA
Normal file
BIN
java/HOTLINK/LOCALS~1.CLA
Normal file
48
java/HOTLINK/LOCALS~1.JAV
Normal file
@@ -0,0 +1,48 @@
|
||||
import java.net.*;
|
||||
|
||||
class LocalServer
|
||||
{
|
||||
private final String mPathIPFileName=new String("ip");
|
||||
private final String mStrID=new String("[IP]");
|
||||
private final int mMinLength=mStrID.length();
|
||||
|
||||
public LocalServer()
|
||||
{
|
||||
}
|
||||
public String getServerIP(String strHostPathFileName)throws Exception
|
||||
{
|
||||
InFile inFile=new InFile(strHostPathFileName,mPathIPFileName);
|
||||
String strServerIP=getServerIP(inFile);
|
||||
inFile.close();
|
||||
return strServerIP;
|
||||
}
|
||||
public String getServerIP(URL resBase)throws Exception
|
||||
{
|
||||
InFile inFile=new InFile(resBase,mPathIPFileName);
|
||||
String strServerIP=getServerIP(inFile);
|
||||
inFile.close();
|
||||
return strServerIP;
|
||||
}
|
||||
private String getServerIP(InFile inFile)throws Exception
|
||||
{
|
||||
String strHost;
|
||||
String strLine;
|
||||
int strLen;
|
||||
|
||||
strLine=new String();
|
||||
strHost=new String();
|
||||
while(true)
|
||||
{
|
||||
try{strLine=inFile.readLine();}
|
||||
catch(Exception exception){return strHost;}
|
||||
strLen=strLine.length();
|
||||
if(strLen<mMinLength)continue;
|
||||
if(0==strLine.substring(0,mMinLength).compareTo(mStrID))
|
||||
{
|
||||
strHost=strLine.substring(mMinLength+1,strLen-1);
|
||||
return strHost;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
BIN
java/HOTLINK/LOCALS~2.CLA
Normal file
BIN
java/HOTLINK/OUTFIL~1.CLA
Normal file
106
java/HOTLINK/OUTFIL~1.JAV
Normal file
@@ -0,0 +1,106 @@
|
||||
import java.net.*;
|
||||
import java.io.*;
|
||||
|
||||
class OutFile
|
||||
{
|
||||
private boolean mIsOkay;
|
||||
private URL mOutFile;
|
||||
private URLConnection mConnection;
|
||||
private DataOutputStream mOutData;
|
||||
private String mStrLine;
|
||||
public OutFile()
|
||||
{
|
||||
mIsOkay=false;
|
||||
}
|
||||
public OutFile(URL resBase,String strHostPathFileName)throws Exception
|
||||
{
|
||||
mIsOkay=false;
|
||||
open(resBase,strHostPathFileName);
|
||||
}
|
||||
public OutFile(String strHostPathFileName)throws Exception
|
||||
{
|
||||
mIsOkay=false;
|
||||
open(strHostPathFileName);
|
||||
}
|
||||
public OutFile(String resBase,String strHostPathFileName)throws Exception
|
||||
{
|
||||
mIsOkay=false;
|
||||
open(resBase,strHostPathFileName);
|
||||
}
|
||||
public void open(URL resBase,String strHostPathFileName)throws Exception
|
||||
{
|
||||
close();
|
||||
try{mOutFile=new URL(resBase,strHostPathFileName);}
|
||||
catch(MalformedURLException exception){throw new Exception();}
|
||||
try{mConnection=mOutFile.openConnection();}
|
||||
catch(Exception exception){throw new Exception();}
|
||||
try{mOutData=new DataOutputStream(mConnection.getOutputStream());}
|
||||
catch(Exception exception){throw new Exception();}
|
||||
mIsOkay=true;
|
||||
}
|
||||
public void open(String resBase,String strHostPathFileName)throws Exception
|
||||
{
|
||||
open(resBase+strHostPathFileName);
|
||||
}
|
||||
public void open(String strHostPathFileName)throws Exception
|
||||
{
|
||||
close();
|
||||
try{mOutFile=new URL(strHostPathFileName);}
|
||||
catch(MalformedURLException exception){throw new Exception();}
|
||||
try{mConnection=mOutFile.openConnection();}
|
||||
catch(IOException ioException){throw new Exception();}
|
||||
try{mOutData=new DataOutputStream(mConnection.getOutputStream());}
|
||||
catch(Exception exception){throw new Exception();}
|
||||
mIsOkay=true;
|
||||
}
|
||||
public void close ()
|
||||
{
|
||||
if(!isOkay())return;
|
||||
try{mOutData.close();}
|
||||
catch(Exception exception){;}
|
||||
mIsOkay=false;
|
||||
}
|
||||
public void flush()throws Exception
|
||||
{
|
||||
if(!isOkay())throw new Exception();
|
||||
mOutData.flush();
|
||||
}
|
||||
|
||||
public void write(String strLine)throws Exception
|
||||
{
|
||||
if(!isOkay())throw new Exception();
|
||||
mOutData.writeBytes(strLine);
|
||||
}
|
||||
public void write(double value)throws Exception
|
||||
{
|
||||
if(!isOkay())throw new Exception();
|
||||
mOutData.writeDouble(value);
|
||||
}
|
||||
public void write(int value)throws Exception
|
||||
{
|
||||
if(!isOkay())throw new Exception();
|
||||
mOutData.writeInt(value);
|
||||
}
|
||||
public int size()
|
||||
{
|
||||
if(!isOkay())return 0;
|
||||
return mOutData.size();
|
||||
}
|
||||
public boolean isOkay()
|
||||
{
|
||||
return mIsOkay;
|
||||
}
|
||||
};
|
||||
|
||||
// public String readLine()throws Exception
|
||||
// {
|
||||
// if(!isOkay())throw new Exception();
|
||||
// try{mStrLine=new String(mInData.readLine());}
|
||||
// catch(IOException ioException){throw new Exception();}
|
||||
// return mStrLine;
|
||||
// }
|
||||
// public boolean isOkay()
|
||||
// {
|
||||
// return mIsOkay;
|
||||
// }
|
||||
//};
|
||||
222
java/HOTLINK/SCRAPS.TXT
Normal file
@@ -0,0 +1,222 @@
|
||||
URL mURL;
|
||||
String mStrString;
|
||||
|
||||
try{inFile=new InFile(getCodeBase(),"ip");}
|
||||
catch(Exception exception){mStrString=new String("Error creating InFile");return;}
|
||||
|
||||
while(true)
|
||||
{
|
||||
try{mStrString=inFile.readLine();}
|
||||
catch(Exception exception){break;} //{mStrString=new String("Error reading InFile");break;}
|
||||
|
||||
|
||||
/*
|
||||
class Animate extends java.applet.Applet
|
||||
{
|
||||
URL mURL;
|
||||
String mStrString;
|
||||
|
||||
public Animate()
|
||||
{
|
||||
}
|
||||
public void init()
|
||||
{
|
||||
InFile inFile;
|
||||
|
||||
try{inFile=new InFile(getCodeBase(),"ip");}
|
||||
catch(Exception exception){mStrString=new String("Error creating InFile");return;}
|
||||
|
||||
while(true)
|
||||
{
|
||||
try{mStrString=inFile.readLine();}
|
||||
catch(Exception exception){break;} //{mStrString=new String("Error reading InFile");break;}
|
||||
repaint();
|
||||
}
|
||||
repaint();
|
||||
}
|
||||
public void start()
|
||||
{
|
||||
}
|
||||
public void stop()
|
||||
{
|
||||
}
|
||||
public void run()
|
||||
{
|
||||
}
|
||||
public void paint(Graphics graphics)
|
||||
{
|
||||
setForeground(Color.red);
|
||||
if(null!=mStrString)graphics.drawString(mStrString,20,20);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
public gotoServer(URL resBase)throws Exception
|
||||
{
|
||||
InFile inFile;
|
||||
String strHost;
|
||||
String strLine;
|
||||
int strLen;
|
||||
|
||||
strHost=new String();
|
||||
try{inFile=new InFile(resBase,mPathIPFileName);}
|
||||
catch(Exception exception){throw exception;}
|
||||
while(true)
|
||||
{
|
||||
try{strLine=inFile.readLine();}
|
||||
catch(Exception exception){break;}
|
||||
strLen=strLine.length();
|
||||
if(strLen<mMinLength)continue;
|
||||
if(0==strLine.substring(0,mMinLength).compareTo(mStrID))
|
||||
{
|
||||
strHost=strLine.substring(mMinLength+1,strLen-1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(null==strHost)throw new Exception();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
FileOutputStream outStream;
|
||||
byte byteArray[];
|
||||
String strString;
|
||||
|
||||
|
||||
try{outStream=new FileOutputStream("outfile");}
|
||||
catch(IOException ioException){return;}
|
||||
strString=new String("SEAN");
|
||||
|
||||
byteArray=new byte[strString.length()];
|
||||
|
||||
strString.getBytes(0,strString.length(),byteArray,0);
|
||||
try{outStream.write(byteArray);}
|
||||
catch(IOException ioExeption){return;}
|
||||
try{outStream.close();}
|
||||
catch(IOException ioExeption){return;}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* URL inFile;
|
||||
URLConnection connection;
|
||||
DataInputStream inData;
|
||||
String strLine;
|
||||
|
||||
try{inFile=new URL(getCodeBase(),"ip");}
|
||||
catch(Exception exception){mStrString=new String("Error creating URL");showStatus(mStrString);repaint();return;}
|
||||
try{connection=inFile.openConnection();}
|
||||
catch(Exception exception){mStrString=new String("Error in URL connection.");showStatus(mStrString);repaint();return;}
|
||||
connection.setUseCaches(false);
|
||||
try{inData=new DataInputStream(connection.getInputStream());}
|
||||
catch(Exception exception){mStrString=new String("Error getting input stream.");showStatus(mStrString);repaint();return;}
|
||||
try{strLine=new String(inData.readLine());inData.close();}
|
||||
catch(Exception exception){mStrString=new String("Error reading data input stream.");showStatus(mStrString);repaint();return;}
|
||||
mStrString=new String(strLine);
|
||||
repaint();
|
||||
*/
|
||||
|
||||
|
||||
|
||||
import java.net.*;
|
||||
|
||||
class LocalServer
|
||||
{
|
||||
private final String mPathIPFileName=new String("IP");
|
||||
private final String mStrID=new String("[IP]");
|
||||
private final int mMinLength=mStrID.length();
|
||||
|
||||
public LocalServer()
|
||||
{
|
||||
}
|
||||
public String getServerIP(String strHostPathFileName)throws Exception
|
||||
{
|
||||
return getServerIP(new InFile(strHostPathFileName));
|
||||
}
|
||||
public String getServerIP(URL resBase)throws Exception
|
||||
{
|
||||
return getServerIP(new InFile(resBase,mPathIPFileName));
|
||||
|
||||
/*
|
||||
InFile inFile;
|
||||
String strHost;
|
||||
String strLine;
|
||||
int strLen;
|
||||
|
||||
strLine=new String();
|
||||
strHost=new String();
|
||||
try{inFile=new InFile(resBase,mPathIPFileName);}
|
||||
catch(Exception exception){throw exception;}
|
||||
while(true)
|
||||
{
|
||||
try{strLine=inFile.readLine();}
|
||||
catch(Exception exception){return strHost;}
|
||||
strLen=strLine.length();
|
||||
if(strLen<mMinLength)continue;
|
||||
if(0==strLine.substring(0,mMinLength).compareTo(mStrID))
|
||||
{
|
||||
strHost=strLine.substring(mMinLength+1,strLen-1);
|
||||
return strHost;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getServerIP(InFile inFile)throws Exception
|
||||
{
|
||||
// InFile inFile;
|
||||
String strHost;
|
||||
String strLine;
|
||||
int strLen;
|
||||
|
||||
strLine=new String();
|
||||
strHost=new String();
|
||||
// try{inFile=new InFile(resBase,mPathIPFileName);}
|
||||
// catch(Exception exception){throw exception;}
|
||||
while(true)
|
||||
{
|
||||
try{strLine=inFile.readLine();}
|
||||
catch(Exception exception){return strHost;}
|
||||
strLen=strLine.length();
|
||||
if(strLen<mMinLength)continue;
|
||||
if(0==strLine.substring(0,mMinLength).compareTo(mStrID))
|
||||
{
|
||||
strHost=strLine.substring(mMinLength+1,strLen-1);
|
||||
return strHost;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// InFile inFile;
|
||||
// String strReturn;
|
||||
//
|
||||
// try{inFile=new InFile(strHostPathFileName,mPathIPFileName);}
|
||||
// catch(Exception exception){return new String("open failed for "+strHostPathFileName+mPathIPFileName);}
|
||||
// strReturn=new String();
|
||||
// try{strReturn=getServerIP(inFile);}
|
||||
// catch(Exception exception){return new String("read failed");}
|
||||
// return strReturn;
|
||||
|
||||
|
||||
|
||||
// String strCodeBase=new String(getCodeBase().toString());
|
||||
// strCodeBase=descendLevel(strCodeBase);
|
||||
// try{mStrParam=localServer.getServerIP(strCodeBase);}
|
||||
// catch(Exception exception){mStrParam="255.255.255.255";}
|
||||
|
||||
|
||||
|
||||
|
||||
124
java/HOTLINK/TMP/HOTLIN~1.JAV
Normal file
@@ -0,0 +1,124 @@
|
||||
import java.awt.*;
|
||||
import java.awt.Font;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Color;
|
||||
import java.util.Date;
|
||||
import java.awt.Frame;
|
||||
import java.awt.image.*;
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
|
||||
public class HotLink extends java.applet.Applet implements Runnable
|
||||
{
|
||||
private Thread mThread;
|
||||
private final int smImageCount=12;
|
||||
private Image[] mLedImages=new Image[smImageCount];
|
||||
private String mStrParam;
|
||||
private String mServerString;
|
||||
private String mURLString;
|
||||
private Button mButton;
|
||||
|
||||
public HotLink()
|
||||
{
|
||||
}
|
||||
public void init()
|
||||
{
|
||||
LocalServer localServer;
|
||||
localServer=new LocalServer();
|
||||
try{mStrParam=localServer.getServerIP(getCodeBase());}
|
||||
catch(Exception exception){mStrParam=new String("255.255.255.255");}
|
||||
mURLString=new String("http://");
|
||||
mURLString+=mStrParam;
|
||||
mButton=new Button("Ganymede");
|
||||
add(mButton);
|
||||
mLedImages[0]=getImage(getCodeBase(),"image/zero.gif");
|
||||
mLedImages[1]=getImage(getCodeBase(),"image/one.gif");
|
||||
mLedImages[2]=getImage(getCodeBase(),"image/two.gif");
|
||||
mLedImages[3]=getImage(getCodeBase(),"image/three.gif");
|
||||
mLedImages[4]=getImage(getCodeBase(),"image/four.gif");
|
||||
mLedImages[5]=getImage(getCodeBase(),"image/five.gif");
|
||||
mLedImages[6]=getImage(getCodeBase(),"image/six.gif");
|
||||
mLedImages[7]=getImage(getCodeBase(),"image/seven.gif");
|
||||
mLedImages[8]=getImage(getCodeBase(),"image/eight.gif");
|
||||
mLedImages[9]=getImage(getCodeBase(),"image/nine.gif");
|
||||
mLedImages[10]=getImage(getCodeBase(),"image/dash.gif");
|
||||
mLedImages[11]=getImage(getCodeBase(),"image/blank.gif");
|
||||
MediaTracker mediaTracker=new MediaTracker(this);
|
||||
for(int imageIndex=0;imageIndex<smImageCount;imageIndex++)mediaTracker.addImage(mLedImages[imageIndex],imageIndex);
|
||||
try(mediaTracker.waitForAll());
|
||||
catch(InterruptedException ie){;}
|
||||
repaint();
|
||||
}
|
||||
public void run()
|
||||
{
|
||||
repaint();
|
||||
}
|
||||
public void start()
|
||||
{
|
||||
if(mThread==null){mThread=new Thread(this);mThread.start();}
|
||||
}
|
||||
public void stop()
|
||||
{
|
||||
if(null!=mThread){mThread.stop();mThread=null;}
|
||||
}
|
||||
public void update(Graphics graphics)
|
||||
{
|
||||
paint(graphics);
|
||||
}
|
||||
public void paint(Graphics graphics)
|
||||
{
|
||||
setBackground(new Color(0x2A,0x7F,0xAA));
|
||||
drawLEDString(mStrParam,graphics);
|
||||
}
|
||||
public void drawLEDString(String strLED,Graphics graphics)
|
||||
{
|
||||
int strLength=strLED.length();
|
||||
int imageWidth;
|
||||
int imageHeight;
|
||||
Point ptLoc;
|
||||
|
||||
ptLoc=new Point(4,4);
|
||||
imageWidth=mLedImages[0].getWidth(this);
|
||||
imageHeight=mLedImages[0].getHeight(this);
|
||||
for(int strIndex=0;strIndex<strLength;strIndex++)
|
||||
{
|
||||
char strChar=strLED.charAt(strIndex);
|
||||
|
||||
if('0'==strChar)graphics.drawImage(mLedImages[0],ptLoc.x,ptLoc.y,this);
|
||||
else if('1'==strChar)graphics.drawImage(mLedImages[1],ptLoc.x,ptLoc.y,this);
|
||||
else if('2'==strChar)graphics.drawImage(mLedImages[2],ptLoc.x,ptLoc.y,this);
|
||||
else if('3'==strChar)graphics.drawImage(mLedImages[3],ptLoc.x,ptLoc.y,this);
|
||||
else if('4'==strChar)graphics.drawImage(mLedImages[4],ptLoc.x,ptLoc.y,this);
|
||||
else if('5'==strChar)graphics.drawImage(mLedImages[5],ptLoc.x,ptLoc.y,this);
|
||||
else if('6'==strChar)graphics.drawImage(mLedImages[6],ptLoc.x,ptLoc.y,this);
|
||||
else if('7'==strChar)graphics.drawImage(mLedImages[7],ptLoc.x,ptLoc.y,this);
|
||||
else if('8'==strChar)graphics.drawImage(mLedImages[8],ptLoc.x,ptLoc.y,this);
|
||||
else if('9'==strChar)graphics.drawImage(mLedImages[9],ptLoc.x,ptLoc.y,this);
|
||||
else if('.'==strChar)graphics.drawImage(mLedImages[10],ptLoc.x,ptLoc.y,this);
|
||||
else graphics.drawImage(mLedImages[11],ptLoc.x,ptLoc.y,this);
|
||||
ptLoc.x+=imageWidth;
|
||||
}
|
||||
graphics.setColor(new Color(48,64,0));
|
||||
graphics.drawLine(3,3,ptLoc.x,3);
|
||||
graphics.drawLine(3,3,3,imageHeight+4);
|
||||
graphics.setColor(new Color(175,192,224));
|
||||
graphics.drawLine(3,imageHeight+4,ptLoc.x,imageHeight+4);
|
||||
graphics.drawLine(ptLoc.x,3,ptLoc.x,imageHeight+4);
|
||||
graphics.setColor(new Color(96,143,208));
|
||||
graphics.drawRect(2,2,(ptLoc.x+1)-2,imageHeight+3);
|
||||
graphics.setColor(new Color(175,192,224));
|
||||
graphics.drawLine(1,1,ptLoc.x+2,1);
|
||||
}
|
||||
public boolean action(Event event,Object object)
|
||||
{
|
||||
if(null!=mButton&&mButton==event.target)
|
||||
{
|
||||
URL localLink;
|
||||
try{localLink=new URL(mURLString);}
|
||||
catch(MalformedURLException exception){return true;}
|
||||
getAppletContext().showDocument(localLink);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
75
java/HOTLINK/TMP/INFILE~1.JAV
Normal file
@@ -0,0 +1,75 @@
|
||||
import java.net.*;
|
||||
import java.io.*;
|
||||
|
||||
class InFile
|
||||
{
|
||||
boolean mIsOkay;
|
||||
private URL mInFile;
|
||||
private URLConnection mConnection;
|
||||
private DataInputStream mInData;
|
||||
private String mStrLine;
|
||||
|
||||
public InFile()
|
||||
{
|
||||
mIsOkay=false;
|
||||
}
|
||||
public InFile(URL resBase,String strHostPathFileName)throws Exception
|
||||
{
|
||||
mIsOkay=false;
|
||||
open(resBase,strHostPathFileName);
|
||||
}
|
||||
public InFile(String strHostPathFileName)throws Exception
|
||||
{
|
||||
mIsOkay=false;
|
||||
open(strHostPathFileName);
|
||||
}
|
||||
public InFile(String resBase,String strHostPathFileName)throws Exception
|
||||
{
|
||||
mIsOkay=false;
|
||||
open(resBase,strHostPathFileName);
|
||||
}
|
||||
public void open(URL resBase,String strHostPathFileName)throws Exception
|
||||
{
|
||||
close();
|
||||
try{mInFile=new URL(resBase,strHostPathFileName);}
|
||||
catch(MalformedURLException exception){throw new Exception();}
|
||||
try{mConnection=mInFile.openConnection();}
|
||||
catch(Exception exception){throw new Exception();}
|
||||
try{mInData=new DataInputStream(mConnection.getInputStream());}
|
||||
catch(Exception exception){throw new Exception();}
|
||||
mIsOkay=true;
|
||||
}
|
||||
public void open(String resBase,String strHostPathFileName)throws Exception
|
||||
{
|
||||
open(resBase+strHostPathFileName);
|
||||
}
|
||||
public void open(String strHostPathFileName)throws Exception
|
||||
{
|
||||
close();
|
||||
try{mInFile=new URL(strHostPathFileName);}
|
||||
catch(MalformedURLException exception){throw new Exception();}
|
||||
try{mConnection=mInFile.openConnection();}
|
||||
catch(IOException ioException){throw new Exception();}
|
||||
try{mInData=new DataInputStream(mConnection.getInputStream());}
|
||||
catch(Exception exception){throw new Exception();}
|
||||
mIsOkay=true;
|
||||
}
|
||||
public void close()
|
||||
{
|
||||
if(!isOkay())return;
|
||||
try{mInData.close();}
|
||||
catch(Exception exception){;}
|
||||
mIsOkay=false;
|
||||
}
|
||||
public String readLine()throws Exception
|
||||
{
|
||||
if(!isOkay())throw new Exception();
|
||||
try{mStrLine=new String(mInData.readLine());}
|
||||
catch(IOException ioException){throw new Exception();}
|
||||
return mStrLine;
|
||||
}
|
||||
public boolean isOkay()
|
||||
{
|
||||
return mIsOkay;
|
||||
}
|
||||
};
|
||||
42
java/HOTLINK/TMP/LOCALS~1.JAV
Normal file
@@ -0,0 +1,42 @@
|
||||
import java.net.*;
|
||||
|
||||
class LocalServer
|
||||
{
|
||||
private final String mPathIPFileName=new String("ip");
|
||||
private final String mStrID=new String("[IP]");
|
||||
private final int mMinLength=mStrID.length();
|
||||
|
||||
public LocalServer()
|
||||
{
|
||||
}
|
||||
public String getServerIP(String strHostPathFileName)throws Exception
|
||||
{
|
||||
return getServerIP(new InFile(strHostPathFileName,mPathIPFileName));
|
||||
}
|
||||
public String getServerIP(URL resBase)throws Exception
|
||||
{
|
||||
return getServerIP(new InFile(resBase,mPathIPFileName));
|
||||
}
|
||||
private String getServerIP(InFile inFile)throws Exception
|
||||
{
|
||||
String strHost;
|
||||
String strLine;
|
||||
int strLen;
|
||||
|
||||
strLine=new String();
|
||||
strHost=new String();
|
||||
while(true)
|
||||
{
|
||||
try{strLine=inFile.readLine();}
|
||||
catch(Exception exception){return strHost;}
|
||||
strLen=strLine.length();
|
||||
if(strLen<mMinLength)continue;
|
||||
if(0==strLine.substring(0,mMinLength).compareTo(mStrID))
|
||||
{
|
||||
strHost=strLine.substring(mMinLength+1,strLen-1);
|
||||
return strHost;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||