text
stringlengths
14
410k
label
int32
0
9
public void setId(String id) { this.id = id; }
0
public final static URL getMbLinksUrl(String artistID) throws MusicbrainzUrlException { if(artistID == null || artistID.equals("")) throw new MusicbrainzUrlException("The artistID is null or empty"); URL url= null; URI uri= null; try { //In case of more than one matches, only the first one...
6
public String getPaese() { return paese; }
0
public void arvoSeuraavaKerrattavaRivi(){ Random random = new Random(); if (kerrattavat.isEmpty()){ paneeli.naytaTekstiaEkassaKentassa("Mitään kerrattavaa ei valittu!"); //vaatii refaktorointia jotta riippuvuus poistuu... } else if (tila == KertausmaatinTila.TYHJA) { // m...
2
public EventManager() { eventToListeners = new HashMap<Class<? extends Event<? extends Listener>>, Bag<? extends Listener>>(); }
3
private void run() { int numCols; int numRows; Scanner sc = new Scanner(System.in); int numSheets = sc.nextInt(); for (int sheet = 1; sheet <= numSheets; sheet++) { numCols = sc.nextInt(); numRows = sc.nextInt(); sc.nextLine(); // Create a new spread sheet. cells = ...
7
public void process(Document doc) throws Exception { this.logs.clear(); this.parameters.clear(); if(doc != null) { this.setTransactionId(Utilities.selectSingleText(doc, "/dc:DCTransaction/dc:TransactionID", XMLLabels.STANDARD_NAMESPACES)); NodeList logNodes = Utilities.selectNodes(doc, "/dc:DCTransa...
3
public void reveal(){ if(gameBoard.isPlaying && isMined()){ setContentAreaFilled(true); setBackground( Color.RED ); revalidate(); repaint(); gameBoard.defeat(); }else{ isRevealed = true; // reduce statistics for victory judgment purposes gameBoard.reduceRemainingC...
9
@Override public String getTextureName() { if (currentState != PlatformState.NORMAL) { // System.out.println("platform" + currentState.toString()); } return "platform" + currentState.toString(); }
1
private void calculateEnabledState(Document doc) { // if there was none ... if (doc == null) { setEnabled(false); // else if it has no name (e.g., it's a new doc, not yet saved) ... } else if (doc.getFileName().equals("")) { setEnabled(true); // else if it has a name, thus it's not a new doc, an...
4
* @param dependOn the index number of pathway this one depends on, -1 if no dependency * @return */ private ArrayList<Queue> pathwayQueues(LayoutInfo[] layouts,int[] dependOn){ ArrayList<Queue> queues = new ArrayList<Queue>();//each queue is for a disconnected group of pathways int n=layou...
7
public static void main(String[] args) { Scanner scanner = new Scanner(System.in); while(scanner.hasNext()) { String label = scanner.next(); if (scanner.hasNextInt()) { // Check if we get the value as an integer int length = scanner.n...
7
protected void fireChangeListeners() { if (this.changeListeners == null) { return; } for (int a = 0; a < this.changeListeners.size(); a++) { ChangeListener l = this.changeListeners.get(a); try { l.stateChanged(new ChangeEvent(this)); ...
3
public boolean setTeacher (Teacher teach, Field f) { //System.out.println("Group.setTeacher() : " + this + " " + teach + " " + f); if (teach != null && f != null && (this.links.getLinks(f).size() == 0) && teach.canTeach(f, this)) { Link l = new Link(teach, this, f); teach.addLink(l); this.links.add(l)...
4
@Override public Packet write(DataOutputStream out, PassthroughConnection ptc, KillableThread thread, boolean serverToClient) { int oldCounter = 0; if(ptc != null) { oldCounter = ptc.packetCounter; } if(!setupFields()) { ptc.printLogMessage("Error creating field data storage for packet: " + packetId);...
7
private String getRightNowTimeStr(final String dateDep, final String secDep, final String dep) { final String month = (Calendar.getInstance().get(Calendar.MONTH) + 1) > 9 // ? String.valueOf(Calendar.getInstance().get(Calendar.MONTH) + 1) : "0" + (Calendar.getInstance().get(Calendar.MONTH) + 1); return // ...
1
private void readChunkUnzip(Inflater inflater, byte[] buffer, int offset, int length) throws IOException { assert(buffer != this.buffer); try { do { int read = inflater.inflate(buffer, offset, length); if(read <= 0) { if(inflater.finished()...
5
public void propertyChange(PropertyChangeEvent evt) { // Short circuit if the following cases are found if (evt.getOldValue() == null && evt.getNewValue() == null) { return; } if (evt.getOldValue() != null && evt.getOldValue().equals(evt.getNewValue())) { ...
8
@Override public synchronized Integer get() { while (isEmpty()) { try { wait(); } catch (InterruptedException ex) { System.out.println("Interrupted exception in thread " + Thread.currentThread() + " while getting an item"); ...
2
public static void main(String args[]) throws InterruptedException, IOException { long timegap = 0; if(args.length == 1) ImageSegFrame.saveFileDir = (args[0]) + ""; else if(args.length == 2) { ImageSegFrame.saveFileDir = args[0] + ""; timegap = Long.parseLong(args[1]);...
7
public void addProductToCart(Product product) { for (Product p : currentCart) { if (p.getId() == product.getId()) { p.addedToCart(); updateCart(); return; } } Product newProduct = new Product(product.getId(), product.getName(), product.getPrice(), product.getCategory(), product.getInvent...
2
@Test public void runTestMethodOverride1() throws IOException { InfoflowResults res = analyzeAPKFile("Callbacks_MethodOverride1.apk"); Assert.assertNotNull(res); Assert.assertEquals(1, res.size()); }
0
public void getBuddyList(String username){ try { String host = "localhost"; socket = new Socket(host, 2001); in = new BufferedReader(new InputStreamReader(socket.getInputStream())); out = new PrintWriter(socket.getOutputStream(), true); } catc...
5
@Override protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws IOException { DatabaseManager manager=DatabaseManager.getManager(); try { ServletResult.sendResult(response, manager.getMultipurposeRoomDao() .deleteById(Integer.parseInt(request.getParameter(ID)))==...
3
private void newLevel() { msg.setMessage("Level " + level, 750); int spawns = (int) (level * 5.5); int maxRockSize = 30 - level; if(maxRockSize < 10) maxRockSize = 10; float minSpeed = 0.1f; float speedMultiplier = level*0.05f + 0.1f; Random r = new Random(); //spawns for (int s = 0; s < spawn...
8
public static List<Enemy> getCurrentEn() { try { enemySemaphore.acquire(); } catch (InterruptedException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } onScreenEnemies.clear(); for(Enemy e: allEnemies) { int tempX = e.getxPos() / 102; int tempY = e.getyPos(...
6
public static void main(String[] args) { String name = args[0]; String dir = args[1]; int port = new Integer(args[2]); String masterServerName = args[3]; String masterServerAdd = args[4]; int masterServerPort = new Integer(args[5]); try { File dir1 = new File(dir); if (!dir1.exists()) dir1.mkdi...
4
public void run() { while(dibujando) { try { Thread.sleep(500); avanzar(); ta.colocarObjetos(Ventana.getSn(),Ventana.getP()); Ventana.li.repaint(); estado(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
2
@Override public void reactToChanges(ObservationEvent ev) { if(ev instanceof ValidateButtonEvent){ ValidateButtonEvent event = (ValidateButtonEvent)ev; String label = ((ValidateButton)event.getSource()).getText(); switch(label){ case OK_label: ...
3
public static byte[] initSalt() throws Exception { byte[] salt = new byte[8]; Random random = new Random(); random.nextBytes(salt); return salt; }
0
private void jbContinuePlayerNamesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbContinuePlayerNamesActionPerformed boolean ready = false; if (MainMenuControl.getSetNumPlayers() == 1) { if (control == 1) { ready = true; } else ...
8
public void printTerms() { System.out.println("WORDS"); for (Term word : termIndex) { System.out.println(word.getName()); } }
1
private void checkPosition(KrakenState state,ArrayList<KrakenMove> list,XYLocation location) { XYLocation kingLocation = state.getKingLocation(color.equals(KrakenColor.WHITE_ITEM)? "b":"w" ); int row,column = location.getYCoOrdinate(); //uprigth moves for (row = location.getXCoOrdinate()-1;row>-1;row--) ...
9
private void initialiseerVeld3(VeldType[][] eenVeldType3) { for (int i = 0; i < eenVeldType3.length; i++) { for (int j = 0; j < eenVeldType3[i].length; j++) { eenVeldType3[i][j] = VeldType.LEEG; } } eenVeldType3[0][1] = VeldType.MUUR; eenVeldType...
2
public String showDetails(){ problem = problemDAO.findById(id); return SUCCESS; }
0
public int executeDownload(ArrayList<Resource> toDownload, ArrayList<String> titles, String filePath, String cookie) { int l = toDownload.size(); System.out.println(titles.size()); try { ExecutorService executor = Executors.newFixedThreadPool(l < 4 ? l : 4); for (Resource resource : toDownload) { St...
7
public static void install() { RepaintManager repaintManager = new NullRepaintManager(); repaintManager.setDoubleBufferingEnabled(false); RepaintManager.setCurrentManager(repaintManager); }
0
public static void unMuteAll(){ // Used for the loops int i; // Used so that the methods associated with a video player can be accessed. VideoPlayer currentVideoPlayer; // Used so that the methods associated with a Audio player can be accessed. AudioPlayer currentAudioPlayer; // Used so that the methods...
6
@Override public void leseDatei(final String pfad){ final File file = new File(pfad); BufferedReader br = null; String linie = null; String[] hilfsArray = null; String s = ""; try{ br = new BufferedReader(new FileReader(file)); //fuelle ein Array mit ganze informationen while ((linie = br.readLine...
8
public static int count(String s) { int cn= 1, cnn = 1, crr = 0; for (int i = s.length()-2; i >= 0; --i) { if (s.charAt(i) == '1' || (s.charAt(i)=='2' && s.charAt(i+1)<='6')) { crr = cn + cnn; } else { crr = cn; } cnn = cn; cn = crr; } return crr; }
4
@Test public void testIncludes1() throws JSONException { int categoryId = 10; Query q = new Query().field("category_ids").includes(categoryId); ReadResponse resp = factual.fetch(TABLE, q); assertOk(resp); for (Map<String, Object> data : resp.getData()) { JSONArray categoryIds = (JSONArray) d...
3
public double[][] possible(double[] in, int player) { max = offset * 4; int full = 0; checked = new boolean[in.length]; double[][] all = new double[max + 1][in.length]; double[][] ret; for (double[] x : all) { System.arraycopy(in, 0, x, 0, x.length); ...
9
public static void main( String[] args ) { if ( MvdTool.testJavaVersion() ) { if ( args.length > 0 ) { if ( args[0].equals("-e") ) printStackTrace = true; else if ( args[0].equals("-h") ) { System.out.println( "java -jar nmerge.jar [-e] [-h]\n" +"-e: enable print stack trace...
5
public static boolean isLambdaProduction(Production production) { if (!isRestrictedOnLHS(production)) return false; String rhs = production.getRHS(); if (rhs.length() == 0) { return true; } return false; }
2
private void getData_without_index(ByteBuffer buf, final int index, OnDataListener dataListener) throws SQLException { int offset = index; final int idx[] = new int[6]; getIndex(buf, offset * 10, idx); int wordid = -1; if ((idx[3] == 0) && ((idx[5] - idx[1]) > 0)) { //word wordid = dataListen...
8
private static boolean doesPatternExistTwice(Map<Byte, byte[]> haystack, byte[] needle) { int twice = 0; for (Byte key : haystack.keySet()) { if (Arrays.equals(haystack.get(key), needle)) { twice++; if (twice =...
3
public void poistaRivi(int rivi) { if (rivi >= 0) { henkilolista.poista(rivi); this.fireTableDataChanged(); } }
1
@Test(expected=IllegalNumberOfOperandsException.class) public void testIllegalANumberOfOperands2(){ calculator.pushOperand(3.0); calculator.pushOperand(4.0); calculator.pushOperand(7.0); calculator.pushPlusOperator(); calculator.pushTimesOperator(); calculator.pushTimesOperator(); calculator.evaluateStac...
0
public ArrayList<int[]> setConnections(Network net) { // Connect layers System.out.println("Setting Connections..."); for (int x = 1; x < net.getLayerAmount() + 1; x++) { int input = 0; System.out.println("Setting connections for layer " + x); do { System.out .println("Please enter which inpu...
4
public void removeItem( GraphItem item ){ items.remove( item ); for( GraphListener listener : listeners() ){ listener.itemRemoved( this, item ); } }
1
public void relicenseDir(File dir) throws IOException { if (dir.isHidden() || dir.getName().startsWith(".")) return; if (dir.isDirectory()) { String[] children = dir.list(); for (int i=0; i<children.length; i++) { relicenseDir(new File(dir, children[i])); } } else { String name = dir.getName(); for (int...
7
public void invert(CPRect r) { CPRect rect = new CPRect(0, 0, width, height); rect.clip(r); for (int j = rect.top; j < rect.bottom; j++) { for (int i = rect.left; i < rect.right; i++) { data[i + j * width] ^= 0xffffff; } } }
2
public void setWrap(boolean wrap) { this.wrap = wrap; }
0
private void handleMessage(Message msg) { Thread processThread = new Thread() { Message msg = null; public void run() { Message responseMsg = null; try { switch (msg.getType()) { case Protocol.REGISTER: responseMsg = process((RegisterRequest) msg); break; case Protocol.D...
9
public void mouseDragged(MouseEvent e) // not used { }
0
static byte[] expandPointTypes(byte[] oldPointTypes, int needed) { final int oldSize = oldPointTypes.length; final int newSizeMin = oldSize + needed; if (newSizeMin < oldSize) { // hard overflow failure - we can't even accommodate // new items without overflowing ...
7
public void testPropertyCompareToMonth() { LocalDate test1 = new LocalDate(TEST_TIME1); LocalDate test2 = new LocalDate(TEST_TIME2); assertEquals(true, test1.monthOfYear().compareTo(test2) < 0); assertEquals(true, test2.monthOfYear().compareTo(test1) > 0); assertEquals(true, test...
2
@Override public void mouseDragged(MouseEvent e) { //if (spawnMenuItem.isEnabled()) { int newX = (int) Math.round(e.getX() / (double) game.getPixelSize()); int newY = (int) Math.round(e.getY() / (double) game.getPixelSize()); if (!game.isInBounds(newX, newY) || (newX == placeX && ne...
5
boolean clauseModelSpec() { int tok = tokPeek(); if (tok == Token.colon || tok == Token.slash) tokenNext(); if (tokPeek() == Token.asterisk) { tokenNext(); return true; } Token tokenModel = tokenNext(); if (tokenModel == null) return invalidModelSpecification(); switch (tokenModel.tok) { cas...
7
private void initCargoPanel() { Object[] columnNames = { "Name", "Size", "Pickup Location", "Delivery Location", "Available At", "Required By" }; cargoTableModel = new DefaultTableModel(columnNames, 0); cargoTableModel.addTableModelListener(this); cargoTable = new JTable(cargoTableModel) { private stat...
7
public void ForceCacheFlush(int flushCount) { // This is only forcing caches with pending updates to flush to DB. The // ChunkCaches will remain intact. for (Map.Entry<String, ChunkCache> cursor : cachesByChunkId.entrySet()) { ChunkCache cache = cursor.getValue(); if (ca...
3
public static String formatMessage(String messageId, Map<String, String> values) { String message = messages.get(messageId); if(message == null) { log.log(Level.WARNING, "No message found for id {0}", messageId); return ""; } if(values == null || values.i...
4
private void disableSpecialVariables () { for (Variable variable : projectVariableList) { if (VariableUtils.mustBeSetToFalse(variable)) { variable.setObfuscate(false); } } }
2
public int getCurrentID(Vector2 pos) { int i = 0; for (GroupedRooms room : rooms) { for (Room r : room.getRooms()) { if (r.contains(pos.X, pos.Y)) { currentId = i; return i; } } i++; } return -999; }
3
public void paintSlopeField(Graphics g, double xmid, double xfactor, double ymid, double yfactor) throws UnresolvedNameException { HashMap<String, Double> h = new HashMap<String, Double>(); for (double x = xbl; x < xbh; x += xlineint) { for (double y = xbl; y < xbh; y += ylineint) { ...
4
public Sundae getSundae() { return sundae; }
0
@Override public void actionPerformed(ActionEvent e) { expandAllSubheads((OutlinerDocument) Outliner.documents.getMostRecentDocumentTouched()); }
0
private boolean proveString(String stringOne, String stringTwo, String stringThree) { if (stringOne.compareTo(stringTwo) == 0 && stringOne.compareTo(stringThree) == 0 && stringTwo.compareTo(stringThree) == 0) { return true; } else if (stringOne.compareTo(stringTwo) != 0 && stringOne.compareTo(stringTh...
6
private void moveDown() { if(imagePanel.getOrientation() == 0) { if(imagePanel.getImageHeight() > imagePanel.getFrameHeight()) { if(Math.abs(imagePanel.getYPos() - 3) < imagePanel.getImageHeight() - imagePanel.getFrameHeight() && imagePanel.getYPos() - 3 <= 0...
8
private int[] processAffectedArray(List<Integer> rowsAffected) { int[] rowsAffectedArray = new int[rowsAffected.size()]; for (int i = 0; i < rowsAffectedArray.length; i++) { rowsAffectedArray[i] = rowsAffected.get(i); } return rowsAffectedArray; }
1
private void createDataset() { final XYSeries series= new XYSeries("data"); for (int i=0; i<this.values.length; i++) series.add(i, this.values[i]); this.dataset= new XYSeriesCollection(series); }
1
private void jj_save(int index, int xla) { JJCalls p = jj_2_rtns[index]; while (p.gen > jj_gen) { if (p.next == null) { p = p.next = new JJCalls(); break; } p = p.next; } p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla; }
2
public static String selectListPageParam(Map<String, Object> paramMap) throws SQLException{ @SuppressWarnings("unchecked") java.util.Map<String,Object> sqlWhereMap = (Map<String, Object>) (paramMap.get("sqlWhereMap")==null ? "": paramMap.get("sqlWhereMap")); BEGIN(); SELECT(User.COLUMNS); FROM(U...
3
@Id @Column(name = "PCA_GRUPO") public Integer getPcaGrupo() { return pcaGrupo; }
0
public List<LngLatAlt> getInteriorRing(int index) { assertExteriorRing(); return coordinates.get(1 + index); }
0
public int getX(){return x;}
0
@Override public Weapon calculateWeapon() { Weapon w = null; Random rnd = new Random(); int code = rnd.nextInt(4); while (code == 0) { code = rnd.nextInt(3); } if (code == 1) { w = Weapon.ROCK; } else if (code == 2) { w = We...
4
public int getBlockLightValue(int par1, int par2, int par3, int par4) { ExtendedBlockStorage var5 = (par2 >> 4 >= storageArrays.length || par2 >> 4 < 0 ? null : storageArrays[par2 >> 4]); if (var5 == null) { return !this.worldObj.worldProvider.hasNoSky && par4 < EnumSkyBlock.Sky...
8
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof AmLogin)) { return false; } AmLogin other = (AmLogin) object; if ((this.id == null && other.id != null) || (thi...
5
public ArrayList<Object> selectByStopStationsPath(ArrayList<Station> stopStations) { if(paths.size() == 0) { // System.out.println("Path not found."); } else { if(paths.size() == 1) { // System.out.println("One path founded."); printPaths(); return paths.get(0); } else { Array...
6
public static void newTournament() { try { List<World> w = new ArrayList(); tournament = new Tournament(w); AntBrain a = new AntBrain("cleverbrain1.brain"); AntBrain b = new AntBrain("cleverbrain2.brain"); AntBrain c = new AntBrain("cleverbrain3.brain"...
2
private void downSafety(final ExprInfo exprInfo) { final Iterator blocks = cfg.nodes().iterator(); while (blocks.hasNext()) { final Block block = (Block) blocks.next(); final Phi phi = exprInfo.exprPhiAtBlock(block); if ((phi == null) || phi.downSafe()) { continue; } final Iterator e = cfg.pr...
4
@Override protected void tick() throws Exception { this.updateKeys(); if (getKey(Keyboard.KEY_ESCAPE)) { this.stopGame(); } if (this.currentScene != null) this.currentScene.tick(); }
2
public int parsePosValue(String value) { int pos = 0; if (value.equals("rc") || value.equals("rightcenter")) { pos = 2; } else if (value.equals("lc") || value.equals("leftcenter")) { pos = 1; } else if (value.startsWith("r")) { pos = 4; } else if (value.startsWith("l")) { pos = 3; } else if ...
7
public void handleEvents() { for (Event event : renderWindow.pollEvents()) { switch (event.type) { case CLOSED: renderWindow.close(); break; case LOST_FOCUS: if (currentScreen instanceof GameScreen) { ...
7
public boolean inBounds(int x, int y) { return x >= 0 && y >= 0 && x < bounds.width && y < bounds.height; }
3
protected static Ptg calcDISC( Ptg[] operands ) { if( operands.length < 4 ) { return new PtgErr( PtgErr.ERROR_NULL ); } debugOperands( operands, "calcDISC" ); try { GregorianCalendar sDate = (GregorianCalendar) DateConverter.getCalendarFromNumber( operands[0].getValue() ); GregorianCalendar mDate...
8
private int addNeighbours(Point p, List<Point> list) { int c = 0; if (p.x - 1 != 0) if (this.maze[p.x - 1][p.y] == true) {list.add(new Point(p.x - 1, p.y));c++;} if (p.x + 1 != this.width - 1) if (this.maze[p.x + 1][p.y] == true) {list.add(new Point(p.x + 1, p.y));c++;} ...
8
protected void optimizeScript(String relpath, File src, File dst) throws IOException { if (relpath.equals("main.scr") || relpath.startsWith("special/")) { FileUtil.copyFile(src, dst); } else { StringBuilder sb = new StringBuilder((int)src.length()); BufferedReader in = new BufferedReader(new InputStrea...
9
private void Login_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Login_ButtonActionPerformed boolean OK=false; if(Visitante_RadioButton.isSelected()){ this.a.setTipoUtilizador("Visitante"); this.dispose(); new Visitante(a).setVisible(true); ...
7
private Map<String, Float> run() { int index = 0, remainingTime = 0; List<Process> processesRan = new ArrayList<Process>(); Map<String, Process> processesStarted = new HashMap<String, Process>(); Map<String, Float> outputs = new HashMap<String, Float>(); for (int i = 0; ...
9
@Override public Implique putImplique(Implique i) throws JSONException, BadResponseException { Representation r = new JsonRepresentation(i.toJSON()); r = serv.putResource("intervention/" + interId + "/implique", null, r); Implique implique = null; try { implique = new Implique(new JsonRepresentation(r).getJ...
2
@Override public int compareTo(MyNumber o) { if(o instanceof MyInteger) { int num = ((MyInteger)o).getIntegerValue(); if(myInt > num) return 1; else if(myInt == num) return 0; else return -1; } else if(o instanceof MyFloat) { double num = ((MyFloat)o).getDoubleValue(); if(myInt > num...
6
private void btnEditarFuncionarioApagarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditarFuncionarioApagarActionPerformed try { if (JOptionPane.showConfirmDialog(rootPane, "Deseja realmente apagar funcionario?") == 0) { carregaObjeto(); ...
3
void releaseResources() { iBold.dispose(); iBold = null; iItalic.dispose(); iItalic = null; iUnderline.dispose(); iUnderline = null; iStrikeout.dispose(); iStrikeout = null; iBorderStyle.dispose(); iBorderStyle = null; iBlockSelection.dispose(); iBlockSelection = null; iLeftAlignment.dispose()...
7
public static boolean[] transform(byte[] rawdata){ boolean[] trans = new boolean[rawdata.length*8]; for(int i=0;i<rawdata.length;i++){ byte data = rawdata[i]; for(int j=0;j<8;j++){ byte probe = (byte) (data & 0x80); data = (byte) (data << ...
2
public PongView(PongModel model) { //initialize the View members: this.model = model; WIDTH_PXL = 600*scale; HEIGHT_PXL = WIDTH_PXL*((int)model.getFieldSize().getHeight())/((int)model.getFieldSize().getWidth()); this.ball = new Ball(); this.bars = Collections.unmodifia...
4
public void draw(Object obj, Component comp, Graphics2D g2, Rectangle rect) { Color color = (Color) AbstractDisplay.getProperty(obj, "color"); Color textColor = Color.BLACK; if (color != null) { g2.setPaint(color); g2.fill(rect); if (color.equals(...
4
public static void samplingCompose(File inDir) throws IOException { // String[] SAMPLES= "s100 s101 s102 s103 s104 s105 s106 s107 s108 s109 s110 s111 s112 s113 s114 s115 s116 s117 s118 s119" String[] MODES = {"context", "spo", "usu"}; // String[] MODES = {"context", "spo"}; // String[] RATES= {"0.5", "0.25", "0.1...
9
public void saveScoreStats () { File file = new File("Scores.txt"); boolean flag = false; FileWriter writer; ArrayList<String> scoreData = new ArrayList<String>(); ListIterator<String> iterator; /* Uses a try statement to catch any exceptions */ try { Scanner s = new Scanner(file); while (s.h...
7