text
stringlengths
14
410k
label
int32
0
9
public static String parseComment (XmlTree t) throws XmlReaderException { StringBuffer s=new StringBuffer(); Enumeration e=t.getContent(); while (e.hasMoreElements()) { XmlTree tree=(XmlTree)e.nextElement(); XmlTag tag=tree.getTag(); if (tag.name().equals("P")) { if (!tree.haschildren()) s.append("\n"...
6
@Override public final void animate() { int var1; int var2; float var3; int var5; int var6; int var7; int var8; int var9; for (var1 = 0; var1 < 16; ++var1) { for (var2 = 0; var2 < 16; ++var2) { var3 = 0F; ...
9
@Before public void setUp() { }
0
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { if (par1World.getBlockMaterial(par3, par4, par5) != Material.water) { return false; } int i = par2Random.nextInt(numberOfBlocks - 2) + 2; int j = 1; for (int k = ...
7
public void setMainClass(String mainClass) { if ((mainClass == null) || (mainClass.length() == 0)) throw new IllegalArgumentException("Main class cannot be null or empty"); this.mainClass = mainClass; }
2
private boolean isEnpassant(Piece gonnaMovePiece, Position gonnaMovePos) { if (gonnaMovePiece.unicode == "\u2659"|| gonnaMovePiece.unicode == "\u265F") { if (isEmptyPlace(gonnaMovePos) && gonnaMovePiece.attackAblePosList.contains(gonnaMovePos)) { return true; } } return false; }
4
private void AbajoM() { //Abajo Punto temp = vibora.get(0);// La antigua Cabeza Punto p = new Punto(); p.x = temp.x; p.y = temp.y + 1; if (validacion(p)) { List<Punto> nueva = new ArrayList<Punto>(); nueva.add(p); nueva.addAll(vibora); if (!esComida(p)) nueva.remove(nueva.size() - 1); ...
2
public void init(){ for (int i = 0; i < 1000 ; i++) { Particle p = new Particle(); p.life = 0.05F; p.fade = (float) (Math.random()/100 + 0.03F); p.x = 40; p.y = 40; particles.add(p); } }
1
public void setAreaC(CompanyType area1) { AreaC = area1; }
0
private static Map<String, List<Double>> parseFile(String filename, int idLine, int id) { String stationLabel; Map<String, List<Double>> stationMap = new HashMap<String, List<Double>>(); String regex = "\"([^\"]*)\".*\",([\\d\\.]+),([\\d\\.]+)"; Pattern pattern = Pattern.compile(regex); Matcher m; ...
6
public final WaiprParser.handler_return handler() throws RecognitionException { WaiprParser.handler_return retval = new WaiprParser.handler_return(); retval.start = input.LT(1); CommonTree root_0 = null; Token ID24=null; Token char_literal25=null; Token char_literal27=null; Token char_literal28=null; ...
6
public static void sort2(Tuple[] arr) { int R = 256; int[] count = new int[R + 1]; Tuple[] aux = new Tuple[arr.length]; //Compute frequency counts for (Tuple t : arr) { count[t.value + 1] += 1; } //Transform counts to indices for (int i = 0; i...
4
public void showArmorHUD(boolean s) { if (armorHUD != null) { armorHUD.shouldRender = s; } }
1
@Override public int hashCode() { int hash = 3; hash = 37 * hash + (this.rootElement != null ? this.rootElement.hashCode() : 0); hash = 37 * hash + (this.documentUrl != null ? this.documentUrl.hashCode() : 0); hash = 37 * hash + (this.documentName != null ? this.documentName.hashCode...
9
public static void main(String[] args) { print("a string"); print(3.14); }
0
public List<List<Integer>> subsetsWithDup(int[] num) { List<List<Integer>> result = new ArrayList<List<Integer>>(); int number = 1 << num.length; Arrays.sort(num); for (int i = 0; i < number; i++) { List<Integer> list = new ArrayList<Integer>(); for (int j = 0; j...
4
public Duck(HuntField field) { this.alive = true; this.type = 'D'; this.field = field; synchronized (field) { this.position = new Position(random.nextInt(field.getXLength()), random.nextInt(field.getYLength())); while (field.isOccupied(position)) { ...
1
protected Label readLabel(int offset, Label[] labels) { if (labels[offset] == null) { labels[offset] = new Label(); } return labels[offset]; }
1
protected boolean isRailValid(World world, int x, int y, int z, int meta) { boolean valid = true; if (!world.isSideSolid(x, y - 1, z, ForgeDirection.UP)) valid = false; if (meta == 2 && !world.isSideSolid(x + 1, y, z, ForgeDirection.UP)) valid = false; else if (me...
9
@Override public void send(String command, Object params) throws Exception { checkInitiate(); final IRemoteCallObject rco = new RemoteCallObject(); synchronized (rco) { rco.setCallObjectId(getNextCallId()); rco.setMetaDataObject(new RemoteCallObjectMetaData(command, RemoteCallObjectType.Messa...
0
private boolean isDataBetter(float[][][] tech, int id, int i) { float[] technicals = TECHNICAL_PRICE_DATA.get(dbSet.get(id)).get( tech[id][i][0]); if (technicals == null) return true; int ok_old = 0; for (float f : technicals) if (f == f) ok_old++; int ok_new = 0; for (float f : tech[id][i])...
5
public static String getTag(BufferedReader reader, String line, String tag) throws TheAppException { line = line.substring(line.indexOf(tag)); StringBuilder builder = new StringBuilder(); while (line != null && (line.indexOf(">")) == -1) { builder.append(line); line = get...
7
public void addChar(char ch) { ch = normalize(ch); char lastchar = grams_.charAt(grams_.length() - 1); if (lastchar == ' ') { grams_ = new StringBuffer(" "); capitalword_ = false; if (ch==' ') return; } else if (grams_.length() >= N_GRAM) { ...
5
private void parseXml(final String filePath){ DocumentBuilderFactory docBldFct = DocumentBuilderFactory.newInstance(); try { DocumentBuilder docBld = docBldFct.newDocumentBuilder(); Document doc = docBld.parse(filePath); traceDom(doc); } catch (ParserConfigurationException e1) { // TODO Auto-generated...
3
void drawParticipant (Graphics g){ g.drawImage(img,x,y, null); // draw player switch(stance){ case forward: if (shift%2 == 1){ img = imgForward; g.drawImage(img, x, y, null); // draw player } else { img = imgForward0; g.drawImage(img, x, y, null); // draw player ...
7
@Override public void setUser(final User user) { this.user = user; }
0
@Override public void endTurn() { if (cooldown > 0) { cooldown--; if (cooldown == 0) { tile = startingPosition; tile.addBomber(this); } //other end-of-turn actions not possible if still dead. } }
2
public static boolean isAllLowerCase(String cs) { if (cs == null || isEmpty(cs)) { return false; } int sz = cs.length(); for (int i = 0; i < sz; i++) { if (Character.isLowerCase(cs.charAt(i)) == false) { return false; } } return true; }
4
public String toString(){ StringBuilder builder = new StringBuilder(Integer.toString(itemId)); for(int i = 0; i < userIds.length; i++){ builder.append("(").append(userIds[i]).append(",").append(ratings[i]).append(")"); } return builder.toString(); }
1
public static int silog2(int v) { while (true) { if (v == 0) return 0; if (v > 0) { int l = 0; while (v != 0) { l++; v >>= 1; } return l + 1; } if (v == -1) ret...
5
@Override public double unsafe_get(int row, int col) { if( row != 0 && col != 0 ) throw new IllegalArgumentException("Row or column must be zero since this is a vector"); int w = Math.max(row,col); if( w == 0 ) { return a1; } else if( w == 1 ) { ...
8
@Override public void update(GameContainer c, StateBasedGame sbg, int delta) throws SlickException { time.update(delta); character.update(c,delta); Input input = c.getInput(); updateCharacterMovement(input,delta); for(Monster monsters : monster){ monsters.update(c); if(monsters.CheckMonInters...
7
public static void fetchAllCategories() { Thread thread = new Thread() { @Override public void run() { super.run(); String updateString = ""; int fetched_cat = 0; int fetched_chan = 0; int size_cat = categor...
6
private Entry<K,V> getPrecedingEntry(K key) { Entry<K,V> p = root; if (p==null) return null; while (true) { int cmp = compare(key, p.key); if (cmp > 0) { if (p.right != null) p = p.right; else ...
7
public boolean saveCommandHistory(String history) { try { if ((history == null) || (this.alMyCommandHistory.contains(history.trim()))) { return true; } if (this.alMyCommandHistory.size() < 10) { if ((history != null) && (history.length() > 150)) { ...
8
private static boolean isNamePart(int c) { return c != ';' && c != '<'; }
1
public CheckResultMessage check9(int day) { int r = get(27, 5); int c = get(28, 5); if (checkVersion(file).equals("2003")) { try { in = new FileInputStream(file); hWorkbook = new HSSFWorkbook(in); if (0 != getValue(r + 3 + day, c, 6).compareTo( getValue(r + 2 + day, c + 3, 6))) { return ...
5
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (ativo ? 1231 : 1237); result = prime * result + ((codigo == null) ? 0 : codigo.hashCode()); result = prime * result + ((email == null) ? 0 : email.hashCode()); result = prime * result + ((idioma == null) ? 0 ...
9
public static void main(String[] args) { ArrayList<Integer> arrayListCopy; // copy of the unsorted array ArrayList<Integer> unsortedArrayList; // array to hold unsorted random numbers int itemCount = 10; // desired count of items in lists int maxNumber = 20; // upper bound of random numb...
3
public void editExhibit(String name, String newName, String description, int[] location, ArrayList<MuseumItem> museumItemList) { ArrayList<String> updatedlist = new ArrayList<String>(); List<Exhibit> list = ExhibitDAO.find(); for(Exhibit e: list) { if(e.getExhibitName().equals(name))...
7
public static void main(String[] args) throws Exception { weka.core.logging.Logger.log(weka.core.logging.Logger.Level.INFO, "Logging started"); LookAndFeel.setLookAndFeel(); try { // uncomment to disable the memory management: //m_Memory.setEnabled(false); m_Viewer = new ArffVie...
7
public static void myPage(String id, Vector<Reserve> pre, Vector<Reserve> current) throws SQLException, NamingException, Exception{ Connection conn = null; PreparedStatement pstmt = null; ResultSet rs = null; DataSource ds = getDataSource(); java.util.Date checkOut; java.util.Date currentDay = new java.util...
8
public void adjustBeginLineColumn(int newLine, int newCol) { int start = tokenBegin; int len; if (bufpos >= tokenBegin) { len = bufpos - tokenBegin + inBuf + 1; } else { len = bufsize - tokenBegin + bufpos + 1 + inBuf; } int i = 0, j = 0, k = 0; int ...
6
public Account() { }
0
private void tick() { if (activeComponent != null) activeComponent.tick(gameControl); }
1
public PreparedStatementCallback<?> getAction() { return action; }
1
@Test public void testMarkReset() throws IOException { for (int i = 0; i < samples.length; i++) { ByteArrayInputStream sample = samples[i]; RepeatableByteSource source = new ByteInputStream(sample, BUFFER_SIZE); source.mark(0); int pos = SIZES[i]; if (BUFFER_SIZE - 2 < pos) pos = BUFFER_SIZE -...
9
public void run() { String msg, response; ChatServerProtocol protocol = new ChatServerProtocol(this); try { // petla czytajaca linnie od klienta i przekazujaca odpowiedz do klienta while ((msg = in.readLine()) != null) { response = protocol.process(msg); ...
2
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed String username = txtUser.getText(); String password = jPasswordField1.getText(); // JDBC driver name and database URL final String JDBC_DRIVER = "com.mysql.jdbc.Drive...
8
protected String formatLatitude(double latitudeInDegrees) { double latitude = ((latitudeInDegrees + 180.0) % 360.0) - 180.0; if (Math.abs(latitude) < 1.0 / 120.0) { return "0°"; } if (latitude > 90.0) { latitude = 180.0 - latitude; } if (latitude <...
4
public final void dumpDecoding(PrintStream port) { int rangeStart = -1; // local code (if >= 0) int delta = 0; for (int i = 0; i <= 0x100; i++) { char unicode = i <= 0xFF ? codes[i] : 0; if (rangeStart >= 0 && (unicode == 0 || unicode - i != delta)) { dump...
7
private void initLogging(int consoleLevel, int fileLevel, boolean exitIfFileFails) { Level consoleLogLevel = LogFormatter.getLogLevel(consoleLevel); Level fileLogLevel = LogFormatter.getLogLevel(fileLevel); Level logLevel = consoleLogLevel.intValue() < fileLogLevel.intValue() ? consoleLogLevel :...
4
public int movesLeft() { if(whoWon() != null){ return 0; } int moveCount = 0; for (int x = 0; x < getRowSize(); x++) { for (int y = 0; y < getColumnSize(); y++) { moveCount += getMoveAt(x, y) == null ? 1 : 0; } } return ...
4
private void clickedConfirm() { this.setEnabled(false); Language lang1 = (Language) boxLang1.getSelectedItem(); Language lang2 = (Language) boxLang2.getSelectedItem(); if ((lang1.getID().equals(lang2.getID())) || txtName.getText().length() == 0 || txtDescription.getText().length() == 0 ) { this.s...
3
* @param var2 The second list * @return result The sum of var1 and var2 */ static LinkedList<Integer> add(LinkedList<Integer>var1, LinkedList<Integer>var2){ LinkedList<Integer> result = new LinkedList<Integer>(); //The sum of var1 and var2 Iterator<Integer> itr1 = var1.iterator(); Iterator<Integer> itr2 ...
8
public static int loadTexture(BufferedImage image, boolean flip){ int[] pixels = new int[image.getWidth() * image.getHeight()]; image.getRGB(0, 0, image.getWidth(), image.getHeight(), pixels, 0, image.getWidth()); ByteBuffer buffer = BufferUtils.createByteBuffer(image.getWidth() * image.getHeight() * BYTES_PER_P...
5
private FreeTimeContainer getBestContainer(Task toPlan, ArrayList<FreeTimeContainer> possibilities) throws PlanningException { FreeTimeContainer best = null; Duration longestDuration = null; int index = -1; if (possibilities != null && possibilities.size() > 0) { index = getFirstPlannableContainerIndex(toPl...
5
public Object nextValue() throws JSONException { char c = nextClean(); String s; switch (c) { case '"': case '\'': return nextString(c); case '{': back(); return new JSONObject(this); case '[': ...
8
public void makeSelection() { if(!list.getSelectedValue().startsWith("-1")) { selection = list.getSelectedValue(); dispose(); } }
1
private void startUpLogicalQueue(GameTime gameTime) { // Iterate and call the start ups of any logical children which are // waited to be added to the GameLayer for (ILogical logicalObject : logicalQueue.getAllWaiting()) { logicalObject.startUp(gameTime); } // Get the list of objects which wanted to be re...
2
@Override public double evaluate(int[][] board) { int r = 0; int n = board.length; int m = board[0].length; int x = 0, y = 0; boolean snakeFinished = false; while (y != m) { if(snakeFinished) { r = Math.max(r, board[x][y]); } ...
9
@Override public void visitStoreExpr(ClassNode c, MethodNode m, StoreExpr expr) { MemberRef field; if(expr.target() instanceof FieldExpr) { field = ((FieldExpr) expr.target()).field(); } else if(expr.target() instanceof StaticFieldExpr) { field = ((StaticFieldExpr) expr.target()).field(); } else { ret...
4
public boolean isSyncCurrentPosition(int syncmode) throws BitstreamException { int read = readBytes(syncbuf, 0, 4); int headerstring = ((syncbuf[0] << 24) & 0xFF000000) | ((syncbuf[1] << 16) & 0x00FF0000) | ((syncbuf[2] << 8) & 0x0000FF00) | ((syncbuf[3] << 0) & 0x000000FF); try { source.unread(syncbuf, 0,...
3
public boolean isSymmetric(TreeNode root) { boolean res = false; L= new ArrayList(); R= new ArrayList(); if( root.left==null && root.right==null){ res = true; }else if( root.left == null || root.right == null){ res = false; }else{ this.inorder(root.left); this.inord...
7
private void updateBackgroundText() { // Setup the semitransparent background timeText backgroundTimeText.setTextOrigin(VPos.BASELINE); backgroundTimeText.setTextAlignment(TextAlignment.RIGHT); backgroundSecondText.setTextOrigin(VPos.BASELINE); backgroundSecondText.setTextAlignm...
8
private static void createDB() { Logger.log("Creating new database."); Connection connection = null; Statement statement = null; try { Class.forName("org.sqlite.JDBC"); connection = DriverManager.getConnection("jdbc:sqlite:"+Settings.DB_PATH); statement = connection.createStatement();...
3
private boolean isSimpleTypeWrapper() { if (typeName.equals("java.lang.Byte")) { return true; } if (typeName.equals("java.lang.Short")) { return true; } if (typeName.equals("java.lang.Integer")) { return true; } if (typeName.equ...
8
public void paintComponent(Graphics g) { super.paintComponent(g); Rectangle area = g.getClip().getBounds(); g.setColor(Color.WHITE); g.fillRect(area.x, area.y, area.width, area.height); if (owner.cellSize > 3) { g.setColor(new Color(0.2F, 0.2F, 0.2F, 1.0F)); for (int x = area.x; x < area....
6
public Symbol parse() throws java.lang.Exception { /* the current action code */ int act; /* the Symbol/stack element returned by a reduce */ Symbol lhs_sym = null; /* information about production being reduced with */ short handle_size, lhs_sym_num; /* set up direct ref...
7
public double computeLogLikelihood(ArrayList<Integer> data, double parameter) { double sum = 0; for (Integer i : data) { if (i == 1) { sum += Math.log(parameter); } else { sum += Math.log(1 - parameter); } } return sum; }
2
protected void prepareBackup() { // start broadcast informing the players about the backup String startBackupMessage = pSystem.getStringProperty(STRING_START_BACKUP_MESSAGE); if (startBackupMessage != null && !startBackupMessage.trim().isEmpty()) { System.out.println(startBackupMess...
6
private static void sort(String alg, Comparable[] a) { String c = (alg.split("[.]"))[0]; String m = (alg.split("[.]"))[1]; try { Class.forName(c).getMethod(m, Comparable[].class) .invoke(null, (Object) a); System.out.println("Sort method : " + alg); // SortHelper.show(a); assert SortHelper.isS...
1
private List<String> shuffle(List<String> list) { List<String> listCopy = Lists.newArrayList(list); Random rnd = new Random(); List<String> res = Lists.newArrayList(); while (!listCopy.isEmpty()) { int index = rnd.nextInt(listCopy.size()); res.add(listCopy.remove(index)); }...
1
private void recalculateWordsInUse() { // Traverse the bitset until a used word is found int i; for (i = wordsInUse - 1; i >= 0; i--) if (words[i] != 0) break; wordsInUse = i + 1; // The new logical size }
2
public Object clone() { if (!sizeIsSticky) trimToSize(); try { BitSet result = (BitSet) super.clone(); result.words = words.clone(); result.checkInvariants(); return result; } catch (CloneNotSupportedExcepti...
2
public int depth() { EvalContext p = this; int depth = 0; while(p!=null) { depth++; p = p.parent; } return depth; }
1
private int leechers() { int count = 0; for (TrackedPeer peer : this.peers.values()) { if (!peer.isCompleted()) { count++; } } return count; }
2
Function parseLines(final List<String> lines) throws AssemblerSyntaxException { resetCurrentLine(); for (final String line : lines) { incCurrentLine(); if (StringUtils.isBlank(line)) { continue; } final List<Token> tokens = scanner.parse(...
6
public void paint(Graphics paramGraphics) { if ((!this.Stopped) && (this.CurrentImage != null)) { deliverImagePaintedEvent(); if ((this.CurrentImageReady) || (this.ProgressiveDraw)) { paramGraphics.drawImage(this.CurrentImage, 0, 0, this); return; } if (this.PreviousI...
5
private static void watcher() { try { WatchService watchService = FileSystems.getDefault().newWatchService(); Path dir = Paths.get("/home/xander/test/"); //registration for file/directory //registration is done on the object being watched. In this case the Path cl...
7
public String login() { dbData(name); if ((name.toUpperCase().equals(dbName.toUpperCase()) && password.equals(dbPassword))) { FacesContext.getCurrentInstance().getExternalContext() .getSessionMap().put("email", name); FacesContext.getCurrentInstance().getExter...
6
public boolean isEmpty ( ){ if(myCount>0){ return false; }else{ return true; } }
1
@Override public boolean execute(MOB mob, List<String> commands, int metaFlags) throws java.io.IOException { String parm = (commands.size() > 1) ? CMParms.combine(commands,1) : ""; if((mob.isAttributeSet(MOB.Attrib.NOBATTLESPAM) && (parm.length()==0))||(parm.equalsIgnoreCase("ON"))) { mob.setAttribute(MOB...
8
@Override public boolean equals (final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass () != obj.getClass ()) { return false; } final Cell other = (Cell) obj; ...
6
public ParseConfig(BufferedReader configFile) throws IOException { String line; while ((line = configFile.readLine()) != null) { line = line.trim(); String[] tokens = line.split("\\s"); //split on whitespace if (tokens.length < 2) continue; if (line.charAt(0) == COMMENT) continue; if...
7
@Override public boolean equals( Object o ) { if ( o == null ) return false; if ( o.getClass( ) != this.getClass( ) ) return false; @SuppressWarnings( "unchecked" ) Range<T> oRange = (com.claygregory.common.data.Range<T> ) o; return ( this.getLowerBound( ) == null && oRange.getLowerBound( ) == nu...
7
public void RightInteract(PlayerInteractEvent event) { Player p = event.getPlayer(); if ((event.hasBlock()) && ((event.getClickedBlock().getState() instanceof Sign)) && (!p.isSneaking())) { Sign s = (Sign) event.getClickedBlock().getState(); String[] line = s.getLines(); if (line[0].equalsIgnoreCase("[xpSh...
8
public static LigneCommandeClient SelectLigneCommandeClientById(int id) throws SQLException { String query = null; LigneCommandeClient commande = new LigneCommandeClient(); ResultSet resultat; try { query = "SELECT * from LIGNE_COMMANDE_CLIENT where ID_LIGNE=? "; ...
2
protected boolean decodeFrame() throws JavaLayerException { try { AudioDevice out = audio; if (out == null) { return false; } Header h = bitstream.readFrame(); if (h == null) { return false; } /...
4
@Override public void messageReceived( ChannelHandlerContext ctx, MessageEvent e ) throws Exception { HttpRequest request = (HttpRequest) e.getMessage(); if ( request.getMethod() != GET ) { sendError( ctx, METHOD_NOT_ALLOWED ); return; } f...
9
@Override public void deserialize(Buffer buf) { int limit = buf.readUShort(); effects = new FightDispellableEffectExtendedInformations[limit]; for (int i = 0; i < limit; i++) { effects[i] = new FightDispellableEffectExtendedInformations(); effects[i].deserialize(buf);...
3
public boolean input(Instance instance) throws Exception { if (getInputFormat() == null) { throw new IllegalStateException("No input instance format defined"); } if (m_NewBatch) { resetQueue(); m_NewBatch = false; } Instance inst = (Instance) instance.copy(); //compute norm of...
8
public void changeRoom(Room nextRoom) { String imagePath = nextRoom.getRoomImagePath(); String charImagePath; String itemImagePath; //remove all from the mainpanel mainpanel.removeAll(); mainpanel.setLayout(null); //draw the characters if exi...
9
public void ecrireFichier(String path, String text) { // PrintWriter ecri; FileWriter writer = null; try { /* ecri = new PrintWriter(new FileWriter(path)); ecri.print(text); ecri.flush(); ecri.close(); */ writer = new FileWriter(path, true); writer.write(text,0,text.length()); write...
2
private void initialize() { if (initialized) { return; } if (this.cacheManager == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("使用默认的EHCache CacheManager"); } InputStream is = null; if (StringUtils.isNotEmpty(configLocation)) { configLocation = StringUtils.replaceOnce(configLocation...
7
private boolean advanceRepeatGroups() throws IOException { for (PhrasePositions[] rg: rptGroups) { if (hasMultiTermRpts) { // more involved, some may not collide int incr; for (int i=0; i<rg.length; i+=incr) { incr = 1; PhrasePositions pp = rg[i]; int k; ...
9
public JTextField getFontSizeTextField() { if (fontSizeTextField == null) { fontSizeTextField = new JTextField(); fontSizeTextField.addFocusListener( new TextFieldFocusHandlerForTextSelection(fontSizeTextField)); fontSizeTextField.addKeyListener( ...
1
@Override public void mouseClicked(MouseEvent e) { if (e.getSource() instanceof PhotoPanel) { PhotoPanel photoPanel = (PhotoPanel) e.getSource(); Image image = photoPanel.getIcon().getImage(); float scale; BufferedImage bi; if(image.getWidth(null) > Constants.MAX_PICTURE_WIDTH){ scale = Co...
5
private void button(){ numInd = Integer.parseInt(jTextField1.getText()); probMut = Double.parseDouble(jTextField4.getText()); enfriamiento = Double.parseDouble(jTextField8.getText()); endogamia = Double.parseDouble(jTextField9.getText()); numGen = Long.parseLong(jTextField2.getText()); rep...
9
public void click(Point p) { for (Map.Entry<String, IButton> entry : buttons.entrySet()) if (entry.getValue().isClicked(p.x, p.y)) { if (entry.getKey().equals("Game")) { try { MegaControlerSingleton.getInstance().getStateView().setState(new Game()); } catch (IOException e1) { e1.printStac...
9