id stringlengths 36 36 | text stringlengths 1 1.25M |
|---|---|
ab3531f1-44a1-4344-bdae-5abcdd9f3aa1 | public Light(int x, int y, Level handle) {
hLevel = handle;
pos = new Point(x, y);
wpos = new Point(x / Level.CELL_SIZE, y / Level.CELL_SIZE);
isActive = true;
isOn = false;
//default color
// final double defR = 0.8235;
// final double def... |
89ec138b-5c79-4bb9-944f-5c988fa8e61a | private void updateBounds() {
bounds = new Rectangle(
pos.x - lightRadius,
pos.y - lightRadius,
lightRadius * 2,
lightRadius * 2);
} |
57e6de8b-4e31-47f1-adf0-09f85d82e08d | public void setColor(double red, double green, double blue) {
r = red;
g = green;
b = blue;
} |
d51ba11e-1396-4351-85de-fe1f39867ac4 | public int getColor() {
return ((int) r) << R_SHIFT + ((int) g) << G_SHIFT + (int) b;
} |
a1b9c4cf-b6c7-42dd-acb0-bd07cbce5592 | public void setRadius(short radius) {
lightRadius = radius;
updateBounds();
updatePixels();
} |
33ef0ef0-71a9-4754-b51c-3a8efad0b8cd | public Point getLight() {
return pos;
} |
38e297a2-0ca9-47ae-853d-83b062c15c28 | public Point getPos() {
return pos;
} |
34434241-869d-4c21-b0f5-c5d9d50b2e82 | public void setOn(boolean on) {
isActive = on;
} |
aeb2b41c-e978-4fd4-9415-0b773a4c3b6f | public boolean isOn() {
return isOn;
} |
179066fa-d22c-43a1-98ee-baf83519ba59 | private double getDistance(int x1, int x2, int y1, int y2) {
x1 = x2 - x1;
y1 = y2 - y1;
return Math.sqrt(x1 * x1 + y1 * y1);
} |
fdedc5a4-914c-41e1-9c5f-dfe5fe9d3413 | public boolean isActive() {
return isActive;
} |
ed5214d6-5ec8-42b4-8a9b-901b79ccb08a | @Override
public boolean isTriggered(Rectangle bbox) {
boolean result = (
pos.x > bbox.x
&& pos.x < (bbox.x + bbox.width)
&& pos.y > bbox.y
&& pos.y < (bbox.y + bbox.height)
&& System.currentTimeMillis() > timeSafe);
... |
a86d319d-b039-44f7-85bf-a2384934bb13 | @Override
public void triggerAction() {
//toggle light
timeSafe = System.currentTimeMillis() + COOLDOWN;
if (isOn) {
isOn = false;
//set world brick dark
hLevel.setCell(wpos.x, wpos.y, Texture.bgLightDead);
} else {
isOn = true;
... |
18c082ff-d8ec-4776-bb17-3cfb3eb8dc4c | public void updatePixels() {
pixels = new double[lightRadius << 1][lightRadius << 1][Util.CHANNELS];
//Center of light glow
double dR;
double dG;
double dB;
double distance;
for (int x = 0, ix = bounds.width - 1;
x < lightRadius;
... |
9fd7aaa4-b319-4a49-b75a-9c05652fe8fd | @Override
public double[][][] getPixels() {
return pixels;
} |
1413d48c-767f-4072-896f-a8f829315843 | @Override
public Rectangle getBounds() {
return bounds;
} |
8cc73f9a-3cc4-4666-8d3c-73c0ece6b8ca | @Override
public short getDrawType() {
// TODO Auto-generated method stub
return 1;
} |
8147a5b7-eb29-4a55-9ada-75dab4d09324 | @Override
public boolean isDrawn() {
return isOn;
} |
210e20ad-964c-4393-8f09-9ad620bec4b4 | @Override
public byte[] getData() {
// TODO Auto-generated method stub
return null;
} |
a5021aa8-42ac-4b95-83d8-e063260a9a57 | public Burst(TexturePack tp) {
super();
super.setImage(tp.get(Texture.spark));
birth = System.nanoTime();
} |
527c3ec5-67f4-44d8-bcf3-4735408a3d71 | @Override
/**
* Draw the entity to the screen, at the entity's current position,
* offset by the camera's position. 8 sparks are drawn at the
* radius' distance from the center. The coordinates correspond
* to the center of the spark burst.
*
* @param comp The component used as o... |
d78fc6f1-e022-4863-a938-1ae0a44dd6a8 | public boolean isDead() {
return expired;
} |
57ef92b0-c19f-4750-8f7d-0afea6b3a71a | public static Level genWorldRandom(int cols, int rows, TexturePack tp) {
/** Brick density. */
final double pBrick = 0.8;
/** Probability of a light in the bg. */
final double pLight = 0.02;
Level level = new Level(cols, rows, tp);
for (int row = 0; row < rows; r... |
384b62f4-2a70-447f-9478-404d5642028b | public static Level genWorldHills(int cols, int rows, TexturePack tp) {
//Chance for ground level to rise
final double pUp = 0.2;
//Chance for ground level to drop
final double pDown = 0.2;
//probability of a hole in the world
final double pHole = 0.1;
//base pro... |
25698a61-1868-48d9-8194-76e5d1dd4f4b | public static Level genWorldPlatform(int cols, int rows, TexturePack tp) {
//initialize an empty world
Level level = new Level(cols, rows, tp);
final double pHole = 0.3;
Point pos = new Point(0, 0);
int litEl = 0;
int xDist = 0;
for (int col = 0; col < cols; col... |
2f3af9a5-9e48-4929-8478-5b479b68020c | public static void genWorldFragments(int cols, int rows, TexturePack tp) {
//Level testLev = new Level(cols, rows, tp);
//Level testLev3 = new Level("fragments.txt", tp);
} |
4d32f456-89d7-44e3-8b77-b98f0e4e92d8 | public Level(String path, TexturePack tPack) {
tp = tPack;
//Open the file for reading
InputStream in = getClass().getResourceAsStream(BASE_PATH + path);
Scanner scan = new Scanner(in);
//Set the array size
cols = scan.nextInt();
rows = scan.nextInt();
... |
5a0b0805-b3d4-4945-b4f0-b2de17883cf4 | public Level(int cols, int rows, TexturePack tPack) {
tp = tPack;
pixels = new double[cols * CELL_SIZE][rows * CELL_SIZE][Util.CHANNELS];
this.cols = cols;
this.rows = rows;
map = new Texture[cols][rows];
initEmpty();
final int defaultStart = rows * CELL_... |
35039300-9b80-4e4e-ac73-826727dfa556 | private void initEmpty() {
for (int col = 0; col < cols; col++) {
for (int row = 0; row < rows; row++) {
map[col][row] = Texture.bg;
}
}
} |
806dbf1a-5a59-42af-9315-268d504f73df | private void init(char[][] data) {
if (data.length != map.length || data[0].length != map[0].length) {
throw new IllegalArgumentException("data array "
+ "does not match level size!");
}
for (int col = 0; col < cols; col++) {
for (int row = 0;... |
2bd0618e-6ab9-4390-80b5-42526e1692db | private Texture translate(char b) {
switch (b) {
case '-':
return Texture.bg;
case 'i':
return Texture.bgLightDead;
case '#':
return Texture.brick;
default:
return Texture.bg;
}
} |
d993c3fb-e244-4b26-9381-7ceee95a372f | public void pasteLevel(int bottom, int left, Level v) {
for (int col = left; col < left + v.getCols(); col++) {
for (int row = bottom; row < bottom + v.getRows(); row++) {
map[col][row] = v.getCell(col, row);
}
}
} |
4ba47ac8-f9cd-40f6-860d-ff744815da02 | public boolean isInBounds(int col, int row) {
if (row < 0 || row >= rows) {
return false;
}
if (col < 0 || col >= cols) {
return false;
}
return true;
} |
e335fce9-5c26-4911-a40b-9207c1aa0ac0 | public void setCell(int col, int row, Texture tx) {
if (!isInBounds(col, row)) {
//target (13,4) out of bounds (0:10), (0:50).
throw new IllegalArgumentException("target (" + row
+ "," + col + ") out of bounds (0:" + rows
+ "), (0:" + cols + ".");
... |
fe75b3bf-330d-4fd5-b842-35fbd6f41b6c | public Texture getCell(int col, int row) {
if (isInBounds(col, row)) {
return map[col][row];
} else {
return Texture.bg;
}
} |
4e6a4b71-bd9d-4e23-8ac9-fbb250dd1580 | public int getCols() {
return cols;
} |
74ab0f37-9b0d-467b-9619-fc06d3da1b06 | public int getRows() {
return rows;
} |
5c2b0286-6b1e-49d6-878b-8b34a4e118d6 | public Point getStart() {
return start;
} |
78ce01d4-dbd5-4bfd-bf78-8128a3e4c102 | public void setStart(Point newStart) {
start = newStart;
} |
f963fb2f-1a61-4599-8842-8cf5d7836674 | public Point getExit() {
return exit;
} |
b5609304-8197-4a02-a85b-8ebf36ac52d4 | public Point[] getAll(Texture tx) {
//how much to increment the array by each time.
final int increment = 20;
//make array size 0
Point[] result = new Point[0];
Point[] temp;
int row = 0;
int col = 0;
byte lightCount = 0;
//while iteration... |
14b139e6-c784-4cef-b35e-9e300589ad53 | private void updatePixels() {
double[][][] iPixels;
//for every block in the world,
for (int col = 0; col < cols; col++) {
for (int row = 0; row < rows; row++) {
//get the pixels for that texture
iPixels = tp.getP(map[col][row]);
... |
50084c07-19f2-414c-b69f-ded4ec620e04 | private void updatePixels(int col, int row) {
double[][][] iPixels;
//get the pixels for that texture
iPixels = tp.getP(map[col][row]);
//paste them into the instance data pixels[][][];
for (int x = col * CELL_SIZE;
x < col * CELL_SIZE + CELL_SIZE;
... |
76893131-3dbe-4ebd-aa4b-536c7585e742 | @Override
public double[][][] getPixels() {
// System.out.println("at 15,30: R=" + pixels[15][30][Util.R]
// + ", G=" + pixels[15][30][Util.G]
// + ", B=" + pixels[15][30][Util.B]);
return pixels;
} |
04a2d189-16b4-4f4d-b604-e6fb6e04ae54 | @Override
public Rectangle getBounds() {
bounds = new Rectangle(0, 0, cols * CELL_SIZE, rows * CELL_SIZE);
return bounds;
} |
3c59fcd7-7ed0-4b1c-880e-4b26023e2507 | @Override
public short getDrawType() {
return drawType;
} |
337ceb4a-c2fb-4e40-9608-1b89ff46358c | public int escapeX(Dynamic obj, double velocity, Point impactZone) {
Rectangle r = obj.getCollisionBox();
int escape = 0;
//if the obj was moving right nudge it left into safety.
if (velocity > 0) {
escape = (impactZone.x * CELL_SIZE - r.width) - r.x;
//... |
83a29bae-a85b-43da-ac84-bdaad00e36b0 | public int escapeY(Dynamic obj, double velocity, Point impactZone) {
Rectangle r = obj.getCollisionBox();
int escape = 0;
//if the obj was moving up nudge it down into safety.
if (velocity > 0) {
escape = (impactZone.y * CELL_SIZE - r.height) - r.y;
//b... |
50ba65ff-4384-40ae-9b09-e528f12ebec5 | @Override
public boolean isDrawn() {
//always draw the level.
return true;
} |
b886448e-6647-42f8-a1b5-ec07cad01733 | @Override
public byte[] getData() {
// TODO Auto-generated method stub
return null;
} |
efa33f33-5c91-46a6-bf88-c141f7374cb1 | public World(int width, int height, TexturePack texPack) {
tp = texPack;
fincomp = new BufferedImage(CELL_SIZE * WORLD_WIDTH,
CELL_SIZE * WORLD_HEIGHT,
BufferedImage.TYPE_INT_ARGB);
background = new BufferedImage(CELL_SIZE * BG_BUFFER_SIZE,
... |
ae76aad3-0463-40ed-b4d6-4502257f274e | public void fillBGBuffer() {
//set the brush to background bricks
for (int y = 0; y < BG_BUFFER_SIZE; y++) {
for (int x = 0; x < BG_BUFFER_SIZE; x++) {
gBG.drawImage(tp.get(Texture.bg),
x * CELL_SIZE,
// Y is upside down, but in this... |
91f3b69c-0416-46b0-80bb-91b4e8c2f012 | public void draw(Graphics page, Component comp, int offsetX, int offsetY) {
int x = 0;
int y = 0;
//Move with the camera
x = -offsetX;
y = offsetY;
//Allow for window resizing
y = y + comp.getHeight() - WORLD_HEIGHT * CELL_SIZE;
//Draw t... |
1212a325-efe5-43c7-9574-d746af747b1f | static BufferedImage deepCopy(BufferedImage bi) {
ColorModel cm = bi.getColorModel();
boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
WritableRaster raster = bi.copyData(null);
return new BufferedImage(cm, raster, isAlphaPremultiplied, null);
} |
db229937-ef3f-4aa1-b2ab-9ab1668bf9b8 | public CDIFactory(Logger log, BeanManager bm) {
this.beanManager = bm;
this.log = log;
} |
f697cb1f-ea13-4ce1-85f8-43c745a5fd0f | public <T> T get(Class<T> clazz) {
Set<Bean<?>> beans = beanManager.getBeans(clazz);
if(beans!=null && beans.size()>0) {
Bean<T> bean = (Bean<T>) beans.iterator().next();
CreationalContext<T> ctx = beanManager.createCreationalContext(bean);
T o = clazz.cast(beanManager.getReference(bean, clazz, ctx))... |
de1f3f53-19bc-4044-9724-e58e5b08106f | public CDIObjectProvider(
Logger log,
@Local CDIFactory cdiFactory) {
this.log = log;
this.cdiFactory = cdiFactory;
} |
50875d34-bd7f-4890-b707-1d467485117c | @SuppressWarnings("unchecked")
public <T> T provide(Class<T> objectType,
AnnotationProvider annotationProvider, ObjectLocator locator) {
/**
* Problem: in many cases a tapestry service will qualify as a cdi bean.
* In order to prevent cdi for managing a service that should be provided by tapestry we chec... |
f1528d1c-cb71-4a75-89c8-fd61d4148575 | protected <T> boolean hasValidScope(Bean<T> bean) {
return bean!=null && allowedScopes.contains(bean.getScope());
} |
4397e6a8-6ead-427f-a091-5b27f35e9051 | public static void bind(ServiceBinder binder) {
binder.bind(ObjectProvider.class, CDIObjectProvider.class).withId("CDIObjectProvider");
} |
1507191c-1937-4815-a9a6-2138af946f81 | public static BeanManager buildBeanManager(Logger log) {
log.info("buildBeanManager");
try {
BeanManager beanManager = (BeanManager) new InitialContext().lookup("java:comp/BeanManager");
return beanManager;
} catch (NamingException e) {
log.error("Could not lookup jndi resource: java:comp/BeanManager... |
015e6d79-49fd-4bff-99e9-ac181c53be4e | public static CDIFactory buildCDIFactory(Logger log, @Local BeanManager beanManager) {
return new CDIFactory(log, beanManager);
} |
26eee862-a909-4797-b892-469acbde84cb | @Contribute(InjectionProvider2.class)
public static void provideInjectionProvider(
OrderedConfiguration<InjectionProvider2> configuration,
@Local CDIFactory cdiFactory,
ComponentClassCache cache) {
// configuration.add("CDI", new CDIInjectionProvider(cdiFactory, cache), "after:*,before:Service");
configura... |
9d191c9b-a8c9-40f9-81c0-2ffff47efe01 | public static void contributeMasterObjectProvider(
@Local ObjectProvider cdiProvider,
OrderedConfiguration<ObjectProvider> configuration) {
// configuration.add("cdiProvider", cdiProvider, "after:Service,after:AnnotationBasedContributions,after:Alias,after:Autobuild");
configuration.add("cdiProvider", cdiPr... |
3e09b3da-d0d2-41df-9de4-2d1764da3b67 | @Contribute(ComponentClassTransformWorker2.class)
public static void provideClassTransformWorkers(
OrderedConfiguration<ComponentClassTransformWorker2> configuration) {
configuration.addInstance("CDI", CDIAnnotationWorker.class, "before:Property");
} |
03a9f080-b363-4867-8b5b-9e56325d5dd8 | public CDIAnnotationWorker(CDIFactory cdiFactory, ComponentClassCache cache) {
this.cdiFactory = cdiFactory;
this.cache = cache;
} |
42d3f52d-c24a-4da0-8481-38acb0f41598 | @Override
public void transform(PlasticClass plasticClass,
TransformationSupport support, MutableComponentModel model) {
for (PlasticField field : plasticClass.getFieldsWithAnnotation(CDI.class)) {
final CDI annotation = field.getAnnotation(CDI.class);
Class type = cache.forName(field.getTypeName());
fin... |
472c4978-f30e-490d-b768-f39fbac668ba | public CDIInjectionProvider(CDIFactory cdiFactory, ComponentClassCache cache) {
this.cdiFactory = cdiFactory;
this.cache = cache;
} |
732d3623-fc61-4a57-8002-99a82e2b18b0 | @Override
public boolean provideInjection(PlasticField field, ObjectLocator locator,
MutableComponentModel componentModel) {
Class type = cache.forName(field.getTypeName());
/**
* Problem: in many cases a tapestry service will qualify as a cdi bean.
* In order to prevent cdi for managing a service that sh... |
005cf375-9235-4506-b554-0d4de4d97530 | public About() {
initialize();
frame.setVisible(true);
} |
4d40bfd9-d0c5-47e6-95dc-6211026c47b1 | private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 450, 300);
/* ํ๋ฉด์ ์ค์์ผ๋ก ์ ๋ ฌ */
Dimension frameSize = frame.getSize();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.heig... |
88309fd2-18af-4c45-acb4-af2123d7b45b | public Server(int port) {
this(port, null);
} |
dc729f85-9382-41bb-9c9e-2814afa49a67 | public Server(int port, ServerGUI sg) {
// GUI or not
this.sg = sg;
// the port
this.port = port;
// to display hh:mm:ss
sdf = new SimpleDateFormat("HH:mm:ss");
// ArrayList for the Client list
al = new ArrayList<ClientThread>();
} |
c2eb6ea5-68da-44d3-bf26-788f0c406b85 | public void start() {
keepGoing = true;
/* create socket server and wait for connection requests */
try {
// the socket used by the server
ServerSocket serverSocket = new ServerSocket(port);
// infinite loop to wait for connections
while (keepGoing) {
// format message saying we are waiting
d... |
b776e7b6-aa96-4ba5-9153-d0149174fb10 | protected void stop() {
keepGoing = false;
// connect to myself as Client to exit statement
// Socket socket = serverSocket.accept();
try {
new Socket("localhost", port);
} catch (Exception e) {
// nothing I can really do
}
} |
97283941-7dff-4184-a581-77fa9eb0667b | private void display(String msg) {
String time = sdf.format(new Date()) + " " + msg;
if (sg == null)
System.out.println(time);
else
sg.appendEvent(time + "\n");
} |
064dfaa8-a0c8-460a-8400-8097beb6cd66 | private synchronized void broadcast(String message) {
// add HH:mm:ss and \n to the message
String time = sdf.format(new Date());
String messageLf = time + " " + message + "\n";
// display message on console or GUI
if (sg == null)
System.out.print(messageLf);
else
sg.appendRoom(messageLf); // append i... |
ebf5ca3d-59e5-4cd2-aa6f-b4a3d350414d | synchronized void remove(int id) {
// scan the array list until we found the Id
for (int i = 0; i < al.size(); ++i) {
ClientThread ct = al.get(i);
// found it
if (ct.id == id) {
al.remove(i);
return;
}
}
} |
69f2b16b-0ca7-421b-812f-0eb3c57e78cc | public static void main(String[] args) {
// protNumber๋ฅผ ์ง์ ํ์ง ์์ผ๋ฉด 1500๋ฒ ํฌํธ๋ก ์
int portNumber = 1500;
new ConnectDB(); // DB์ฐ๊ฒฐ ์์
// ์ธ์์ ํํ์ ๋ฐ๋ฅธ ์ถ
switch (args.length) {
case 1:
try {
portNumber = Integer.parseInt(args[0]);
} catch (Exception e) {
System.out.println("Invalid port number.");
... |
0063b6eb-b6c6-41a2-bbea-8ee6cf684303 | ClientThread(Socket socket) {
// ๊ณ ์ ID
id = ++uniqueId;
this.socket = socket;
/* ๋ฐ์ดํฐ ์คํธ๋ฆผ์ ์์ฑ */
System.out.println("Thread trying to create Object Input/Output Streams");
try {
// ์ถ๋ ฅ์ ์์ฑ.
sOutput = new ObjectOutputStream(socket.getOutputStream());
sInput = new ObjectInputStream(socket.getI... |
d92ecfd8-e997-49aa-a24d-13d2d19bc5cc | public void run() {
// to loop until LOGOUT
boolean keepGoing = true;
while (keepGoing) {
// read a String (which is an object)
try {
cm = (ChatMessage) sInput.readObject();
} catch (IOException e) {
display(username + " Exception reading Streams: " + e);
break;
} catch (ClassNot... |
aaaecfae-eb56-4b3e-9424-893eccfce0e5 | private void close() {
// try to close the connection
try {
if (sOutput != null)
sOutput.close();
} catch (Exception e) {
}
try {
if (sInput != null)
sInput.close();
} catch (Exception e) {
}
;
try {
if (socket != null)
socket.close();
} catch (Exception e) {
... |
29ab8738-b07a-46e2-bb3d-5d0a3ae540f3 | private boolean writeMsg(String msg) {
// if Client is still connected send the message to it
if (!socket.isConnected()) {
close();
return false;
}
// write the message to the stream
try {
sOutput.writeObject(msg);
}
// if an error occurs, do not abort just inform the user
catch (IOE... |
9dd94cce-af70-4bb6-9702-2dec24b7060c | ChatMessage(int type, String message) {
this.type = type;
this.message = message;
} |
dbcae27e-f898-41d0-9976-927ab63eacda | int getType() {
return type;
} |
178f038d-6e01-42cb-a8b6-4db43002b34b | String getMessage() {
return message;
} |
41ab4d90-b4c6-4dcb-ac86-09f1b8f21df4 | public MainFrame() {
initialize();
frmEbms.setVisible(true);
} |
8bf23f58-a038-4fa9-a5ab-53191e9cc666 | private void initialize() {
frmEbms = new JFrame();
frmEbms.setTitle("EBMS");
frmEbms.setBounds(100, 100, 800, 600);
frmEbms.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
/* ํ๋ฉด์ ์ค์์ผ๋ก ์ ๋ ฌ */
Dimension frameSize = frmEbms.getSize();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
f... |
1cde594d-b382-4fec-917e-a459a6065876 | public void actionPerformed(ActionEvent e) {
About af = new About();
} |
94a0d5e8-b67b-4c3b-afa4-c174f8d74a49 | ServerGUIList() {
super("Chat Server");
setTitle("List");
// need to be informed when the user click the close button on the frame
setSize(300, 400);
// ํ๋ฉด ์ฌ์ด์ฆ ๊ตฌํ๊ธฐ ๋ฐ ํ๋ฉด ์ค์์ ์ถ๋ ฅ
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
Dimension f_size = this.getSize();
int xpos = (int) ((screen.ge... |
0afb4357-9229-4760-a1d1-4376566be3f7 | @Override
public void windowActivated(WindowEvent arg0) {
} |
67502565-1ee1-48f4-b0b0-67fe7ce02175 | @Override
public void windowClosed(WindowEvent arg0) {
} |
fe086bd4-49e9-4699-8223-43e8946a4ffa | @Override
public void windowClosing(WindowEvent arg0) {
} |
1d3a2305-740a-4319-a70a-a7fbd7749f3e | @Override
public void windowDeactivated(WindowEvent arg0) {
} |
67fda17d-2cae-4b69-8382-3fbec8254e96 | @Override
public void windowDeiconified(WindowEvent arg0) {
} |
edfaad19-cedb-4ede-b8d5-dde10636e2b7 | @Override
public void windowIconified(WindowEvent arg0) {
} |
43b4fa33-3a92-4e9c-830e-f7ee6e3a7fe3 | @Override
public void windowOpened(WindowEvent arg0) {
} |
7386095d-38bb-429a-8449-1ee48f967f29 | @Override
public void actionPerformed(ActionEvent arg0) {
} |
e146c068-ff78-413c-8c1f-3913b12ffdc4 | ServerGUI(int port) {
super("Chat Server");
setTitle("Server");
server = null;
JPanel north = new JPanel();
north.add(new JLabel("Port number: "));
tPortNumber = new JTextField(" " + port);
north.add(tPortNumber);
// to stop or start the server, we start with "Start"
stopStart = new JButton("Start... |
583a73c2-f2a9-49c5-b4b7-a5abe6c7bbd9 | void appendRoom(String str) {
event.append(str);
event.setCaretPosition(event.getText().length() - 1);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.