bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; }
private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; }
7,627
private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; }
private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; }
7,628
private long getLinearDay(int year, int dayOfYear, boolean gregorian) { // The 13 is the number of days, that were omitted in the Gregorian // Calender until the epoch. // We shift right by 2 instead of dividing by 4, to get correct // results for negative years (and this is even more efficient). long julianDay = ((year * (365L * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13); if (gregorian) { // subtract the days that are missing in gregorian calendar // with respect to julian calendar. // // Okay, here we rely on the fact that the gregorian // calendar was introduced in the AD era. This doesn't work // with negative years. // // The additional leap year factor accounts for the fact that // a leap day is not seen on Jan 1 of the leap year. int gregOffset = (year / 400) - (year / 100) + 2; if (isLeapYear (year, true) && dayOfYear < 31 + 29) --gregOffset; julianDay += gregOffset; } return julianDay; }
private long getLinearDay(int year, int dayOfYear, boolean gregorian) { // The 13 is the number of days, that were omitted in the Gregorian // Calender until the epoch. // We shift right by 2 instead of dividing by 4, to get correct // results for negative years (and this is even more efficient). long julianDay = ((year * (365L * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13); if (gregorian) { // subtract the days that are missing in gregorian calendar // with respect to julian calendar. // // Okay, here we rely on the fact that the gregorian // calendar was introduced in the AD era. This doesn't work // with negative years. // // The additional leap year factor accounts for the fact that // a leap day is not seen on Jan 1 of the leap year. int gregOffset = (year / 400) - (year / 100) + 2; if (isLeapYear (year, true) && dayOfYear < 31 + 29) --gregOffset; julianDay += gregOffset; } return julianDay; }
7,629
private long getLinearDay(int year, int dayOfYear, boolean gregorian) { // The 13 is the number of days, that were omitted in the Gregorian // Calender until the epoch. // We shift right by 2 instead of dividing by 4, to get correct // results for negative years (and this is even more efficient). long julianDay = ((year * (365L * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13); if (gregorian) { // subtract the days that are missing in gregorian calendar // with respect to julian calendar. // // Okay, here we rely on the fact that the gregorian // calendar was introduced in the AD era. This doesn't work // with negative years. // // The additional leap year factor accounts for the fact that // a leap day is not seen on Jan 1 of the leap year. int gregOffset = (year / 400) - (year / 100) + 2; if (isLeapYear (year, true) && dayOfYear < 31 + 29) --gregOffset; julianDay += gregOffset; } return julianDay; }
private long getLinearDay(int year, int dayOfYear, boolean gregorian) { // The 13 is the number of days, that were omitted in the Gregorian // Calender until the epoch. // We shift right by 2 instead of dividing by 4, to get correct // results for negative years (and this is even more efficient). long julianDay = ((year * (365L * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13); if (gregorian) { // subtract the days that are missing in gregorian calendar // with respect to julian calendar. // // Okay, here we rely on the fact that the gregorian // calendar was introduced in the AD era. This doesn't work // with negative years. // // The additional leap year factor accounts for the fact that // a leap day is not seen on Jan 1 of the leap year. int gregOffset = (year / 400) - (year / 100) + 2; if (isLeapYear (year, true) && dayOfYear < 31 + 29) --gregOffset; julianDay += gregOffset; } return julianDay; }
7,630
private long getLinearTime(int year, int dayOfYear, int millis) { // The 13 is the number of days, that were omitted in the Gregorian // Calendar until the epoch. // We shift right by 2 instead of dividing by 4, to get correct // results for negative years (and this is even more efficient). int julianDay = ((year * (365 * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13); long time = julianDay * (24 * 60 * 60 * 1000L) + millis; if (time >= gregorianCutover) { // subtract the days that are missing in gregorian calendar // with respect to julian calendar. // // Okay, here we rely on the fact that the gregorian // calendar was introduced in the AD era. This doesn't work // with negative years. // // The additional leap year factor accounts for the fact that // a leap day is not seen on Jan 1 of the leap year. // And on and after the leap day, the leap day has already been // included in dayOfYear. int gregOffset = (year / 400) - (year / 100) + 2; if (isLeapYear (year, true)) --gregOffset; time += gregOffset * (24 * 60 * 60 * 1000L); } return time; }
private long getLinearTime(int year, int dayOfYear, int millis) { // The 13 is the number of days, that were omitted in the Gregorian // Calendar until the epoch. // We shift right by 2 instead of dividing by 4, to get correct // results for negative years (and this is even more efficient). int julianDay = ((year * (365 * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13); long time = julianDay * (24 * 60 * 60 * 1000L) + millis; if (time >= gregorianCutover) { // subtract the days that are missing in gregorian calendar // with respect to julian calendar. // // Okay, here we rely on the fact that the gregorian // calendar was introduced in the AD era. This doesn't work // with negative years. // // The additional leap year factor accounts for the fact that // a leap day is not seen on Jan 1 of the leap year. // And on and after the leap day, the leap day has already been // included in dayOfYear. int gregOffset = (year / 400) - (year / 100) + 2; if (isLeapYear (year, true)) --gregOffset; time += gregOffset * (24 * 60 * 60 * 1000L); } return time; }
7,631
private long getLinearTime(int year, int dayOfYear, int millis) { // The 13 is the number of days, that were omitted in the Gregorian // Calendar until the epoch. // We shift right by 2 instead of dividing by 4, to get correct // results for negative years (and this is even more efficient). int julianDay = ((year * (365 * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13); long time = julianDay * (24 * 60 * 60 * 1000L) + millis; if (time >= gregorianCutover) { // subtract the days that are missing in gregorian calendar // with respect to julian calendar. // // Okay, here we rely on the fact that the gregorian // calendar was introduced in the AD era. This doesn't work // with negative years. // // The additional leap year factor accounts for the fact that // a leap day is not seen on Jan 1 of the leap year. // And on and after the leap day, the leap day has already been // included in dayOfYear. int gregOffset = (year / 400) - (year / 100) + 2; if (isLeapYear (year, true)) --gregOffset; time += gregOffset * (24 * 60 * 60 * 1000L); } return time; }
private long getLinearTime(int year, int dayOfYear, int millis) { // The 13 is the number of days, that were omitted in the Gregorian // Calendar until the epoch. // We shift right by 2 instead of dividing by 4, to get correct // results for negative years (and this is even more efficient). int julianDay = ((year * (365 * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13); long time = julianDay * (24 * 60 * 60 * 1000L) + millis; if (time >= gregorianCutover) { // subtract the days that are missing in gregorian calendar // with respect to julian calendar. // // Okay, here we rely on the fact that the gregorian // calendar was introduced in the AD era. This doesn't work // with negative years. // // The additional leap year factor accounts for the fact that // a leap day is not seen on Jan 1 of the leap year. // And on and after the leap day, the leap day has already been // included in dayOfYear. int gregOffset = (year / 400) - (year / 100) + 2; if (isLeapYear (year, true)) --gregOffset; time += gregOffset * (24 * 60 * 60 * 1000L); } return time; }
7,632
private int getWeekDay(int year, int dayOfYear) { int day = (int) (getLinearTime(year, dayOfYear, 0) / (24 * 60 * 60 * 1000L)); // The epoch was a thursday. int weekday = (day + THURSDAY) % 7; if (weekday <= 0) weekday += 7; return weekday; }
private int getWeekDay(int year, int dayOfYear) { int day = (int) (getLinearTime(year, dayOfYear, 0) / (24 * 60 * 60 * 1000L)); // The epoch was a thursday. int weekday = (day + THURSDAY) % 7; if (weekday <= 0) weekday += 7; return weekday; }
7,633
public boolean isLeapYear(int year) { if ((year & 3) != 0) // Only years divisible by 4 can be leap years return false; // compute the linear day of the 29. February of that year. // The 13 is the number of days, that were omitted in the Gregorian // Calender until the epoch. int julianDay = (((year-1) * (365*4+1)) >> 2) + (31+29 - (((1970-1) * (365*4+1)) / 4 + 1 - 13)); // If that day is smaller than the gregorianChange the julian // rule applies: This is a leap year since it is divisible by 4. if (julianDay * (24 * 60 * 60 * 1000L) < gregorianCutover) return true; return ((year % 100) != 0 || (year % 400) == 0); }
public boolean isLeapYear(int year) { if ((year & 3) != 0) // Only years divisible by 4 can be leap years return false; // compute the linear day of the 29. February of that year. // The 13 is the number of days, that were omitted in the Gregorian // Calender until the epoch. int julianDay = (((year-1) * (365*4+1)) >> 2) + (31+29 - (((1970-1) * (365*4+1)) / 4 + 1 - 13)); // If that day is smaller than the gregorianChange the julian // rule applies: This is a leap year since it is divisible by 4. if (julianDay * (24 * 60 * 60 * 1000L) < gregorianCutover) return true; return ((year % 100) != 0 || (year % 400) == 0); }
7,634
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("model")) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
7,638
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) { ListModel oldModel = (ListModel) e.getOldValue(); oldModel.removeListDataListener(listDataListener); } if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) { ListModel newModel = (ListModel) e.getNewValue(); newModel.addListDataListener(BasicListUI.this.listDataListener); } if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
7,639
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
7,640
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
7,641
public Rectangle getCellBounds(JList l, int index1, int index2) { maybeUpdateLayoutState(); if (l != list || cellWidth == -1) return null; int minIndex = Math.min(index1, index2); int maxIndex = Math.max(index1, index2); Point loc = indexToLocation(list, minIndex); Rectangle bounds = new Rectangle(loc.x, loc.y, cellWidth, getCellHeight(minIndex)); for (int i = minIndex + 1; i <= maxIndex; i++) { Point hiLoc = indexToLocation(list, i); Rectangle hibounds = new Rectangle(hiLoc.x, hiLoc.y, cellWidth, getCellHeight(i)); bounds = bounds.union(hibounds); } return bounds; }
public Rectangle getCellBounds(JList l, int index1, int index2) { maybeUpdateLayoutState(); if (l != list || cellWidth == -1) return null; int minIndex = Math.min(index1, index2); int maxIndex = Math.max(index1, index2); Point loc = indexToLocation(list, minIndex); int width = cellWidth; if (l.getLayoutOrientation() == JList.VERTICAL) width = l.getWidth(); Rectangle bounds = new Rectangle(loc.x, loc.y, width, getCellHeight(minIndex)); for (int i = minIndex + 1; i <= maxIndex; i++) { Point hiLoc = indexToLocation(list, i); Rectangle hibounds = new Rectangle(hiLoc.x, hiLoc.y, cellWidth, getCellHeight(i)); bounds = bounds.union(hibounds); } return bounds; }
7,642
public Rectangle getCellBounds(JList l, int index1, int index2) { maybeUpdateLayoutState(); if (l != list || cellWidth == -1) return null; int minIndex = Math.min(index1, index2); int maxIndex = Math.max(index1, index2); Point loc = indexToLocation(list, minIndex); Rectangle bounds = new Rectangle(loc.x, loc.y, cellWidth, getCellHeight(minIndex)); for (int i = minIndex + 1; i <= maxIndex; i++) { Point hiLoc = indexToLocation(list, i); Rectangle hibounds = new Rectangle(hiLoc.x, hiLoc.y, cellWidth, getCellHeight(i)); bounds = bounds.union(hibounds); } return bounds; }
public Rectangle getCellBounds(JList l, int index1, int index2) { maybeUpdateLayoutState(); if (l != list || cellWidth == -1) return null; int minIndex = Math.min(index1, index2); int maxIndex = Math.max(index1, index2); Point loc = indexToLocation(list, minIndex); Rectangle bounds = new Rectangle(loc.x, loc.y, cellWidth, getCellHeight(minIndex)); for (int i = minIndex + 1; i <= maxIndex; i++) { Point hiLoc = indexToLocation(list, i); Rectangle hibounds = new Rectangle(hiLoc.x, hiLoc.y, width, getCellHeight(i)); bounds = bounds.union(hibounds); } return bounds; }
7,643
protected void maybeUpdateLayoutState() { if (updateLayoutStateNeeded != 0 || !list.isValid()) { updateLayoutState(); updateLayoutStateNeeded = 0; } }
protected void maybeUpdateLayoutState() { if (updateLayoutStateNeeded != 0) { updateLayoutState(); updateLayoutStateNeeded = 0; } }
7,644
protected void updateLayoutState() { int nrows = list.getModel().getSize(); cellHeight = -1; cellWidth = -1; if (cellHeights == null || cellHeights.length != nrows) cellHeights = new int[nrows]; ListCellRenderer rend = list.getCellRenderer(); // Update the cellHeight(s) fields. int fixedCellHeight = list.getFixedCellHeight(); if (fixedCellHeight > 0) { cellHeight = fixedCellHeight; cellHeights = null; } else { cellHeight = -1; for (int i = 0; i < nrows; ++i) { Component flyweight = rend.getListCellRendererComponent(list, list.getModel().getElementAt(i), i, list.isSelectedIndex(i), list.getSelectionModel().getAnchorSelectionIndex() == i); Dimension dim = flyweight.getPreferredSize(); cellHeights[i] = dim.height; } } // Update the cellWidth field. int fixedCellWidth = list.getFixedCellWidth(); if (fixedCellWidth > 0) cellWidth = fixedCellWidth; else { for (int i = 0; i < nrows; ++i) { Component flyweight = rend.getListCellRendererComponent(list, list.getModel().getElementAt(i), i, list.isSelectedIndex(i), list.getSelectionModel().getAnchorSelectionIndex() == i); Dimension dim = flyweight.getPreferredSize(); cellWidth = Math.max(cellWidth, dim.width); } if (list.getLayoutOrientation() == JList.VERTICAL) cellWidth = Math.max(cellWidth, list.getSize().width); } }
protected void updateLayoutState() { int nrows = list.getModel().getSize(); cellHeight = -1; cellWidth = -1; if (cellHeights == null || cellHeights.length != nrows) cellHeights = new int[nrows]; ListCellRenderer rend = list.getCellRenderer(); // Update the cellHeight(s) fields. int fixedCellHeight = list.getFixedCellHeight(); if (fixedCellHeight > 0) { cellHeight = fixedCellHeight; cellHeights = null; } else { cellHeight = -1; for (int i = 0; i < nrows; ++i) { Component flyweight = rend.getListCellRendererComponent(list, list.getModel().getElementAt(i), i, list.isSelectedIndex(i), list.getSelectionModel().getAnchorSelectionIndex() == i); Dimension dim = flyweight.getPreferredSize(); cellHeights[i] = dim.height; } } // Update the cellWidth field. int fixedCellWidth = list.getFixedCellWidth(); if (fixedCellWidth > 0) cellWidth = fixedCellWidth; else { for (int i = 0; i < nrows; ++i) { Component flyweight = rend.getListCellRendererComponent(list, list.getModel().getElementAt(i), i, list.isSelectedIndex(i), list.getSelectionModel().getAnchorSelectionIndex() == i); Dimension dim = flyweight.getPreferredSize(); cellWidth = Math.max(cellWidth, dim.width); } if (list.getLayoutOrientation() == JList.VERTICAL) cellWidth = Math.max(cellWidth, list.getSize().width); } }
7,645
public String[] getCompilerPackages() { return new String[] { "org.jnode.vm.x86.compiler", "org.jnode.vm.x86.compiler.stup" }; }
public String[] getCompilerPackages() { return new String[] { "org.jnode.vm.x86.compiler", "org.jnode.vm.x86.compiler.stub" }; }
7,646
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { log.debug("using firstProvider "+firstProvName); return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider log.debug("font="+font+" provider="+prv); if (prv.provides(font)) { log.debug("provider found"); return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider log.debug("font="+font+" provider="+prv); if (prv.provides(font)) { log.debug("provider found"); return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
7,647
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { log.debug("using firstProvider "+firstProvName); return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider log.debug("font="+font+" provider="+prv); if (prv.provides(font)) { log.debug("provider found"); return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { log.debug("using firstProvider "+firstProvName); return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider log.debug("font="+font+" provider="+prv); if (prv.provides(font)) { log.debug("provider found"); return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
7,648
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { log.debug("using firstProvider "+firstProvName); return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider log.debug("font="+font+" provider="+prv); if (prv.provides(font)) { log.debug("provider found"); return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { log.debug("using firstProvider "+firstProvName); return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider if (prv.provides(font)) { log.debug("provider found"); return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
7,649
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { log.debug("using firstProvider "+firstProvName); return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider log.debug("font="+font+" provider="+prv); if (prv.provides(font)) { log.debug("provider found"); return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { log.debug("using firstProvider "+firstProvName); return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider log.debug("font="+font+" provider="+prv); if (prv.provides(font)) { return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
7,650
public void paint(Graphics g) { paintComponent(g); }
public void paint(Graphics g) { Component view = getView(); if (view == null) return; Point pos = getViewPosition(); Rectangle viewBounds = view.getBounds(); Rectangle portBounds = getBounds(); if (viewBounds.width == 0 || viewBounds.height == 0 || portBounds.width == 0 || portBounds.height == 0) return; switch (getScrollMode()) { case JViewport.BACKINGSTORE_SCROLL_MODE: paintBackingStore(g); break; case JViewport.BLIT_SCROLL_MODE: paintBlit(g); break; case JViewport.SIMPLE_SCROLL_MODE: default: paintSimple(g); break; } damaged = false; }
7,652
public void setViewSize(Dimension newSize) { viewSize = newSize; Component view = getView(); if (view != null) view.setSize(viewSize); isViewSizeSet = true; fireStateChanged(); }
public void setViewSize(Dimension newSize) { viewSize = newSize; Component view = getView(); if (view != null) view.setSize(viewSize); fireStateChanged(); }
7,656
public INodeTable(Ext2FileSystem fs, int firstBlock) throws IOException { this.fs = fs; this.firstBlock = firstBlock; blockSize=(int)fs.getBlockSize(); blockCount = (int)Math.ceil( (double)(fs.getSuperblock().getINodesPerGroup()*INode.INODE_LENGTH) / (double) blockSize); }
public INodeTable(Ext2FileSystem fs, int firstBlock) throws IOException { this.fs = fs; this.firstBlock = firstBlock; blockSize=(int)fs.getBlockSize(); blockCount = (int)Math.ceil( (double)(fs.getSuperblock().getINodesPerGroup()*INode.INODE_LENGTH) / (double) blockSize); }
7,658
final void gc() { // Prepare final VmBootHeap bootHeap = heapManager.getBootHeap(); final VmAbstractHeap firstHeap = heapManager.getFirstHeap(); stats.lastGCTime = System.currentTimeMillis(); final boolean locking = (writeBarrier != null); final boolean verbose = debug; helper.stopThreadsAtSafePoint(); heapManager.setGcActive(true); try { // Mark //helper.stopThreadsAtSafePoint(); //heapManager.setGcActive(true); try { if (verbose) { Unsafe.debug("<mark/>"); } markHeap(bootHeap, firstHeap, locking); } finally { //heapManager.setGcActive(false); //helper.restartThreads(); } // Sweep if (verbose) { Unsafe.debug("<sweep/>"); } sweep(firstHeap); // Cleanup if (verbose) { Unsafe.debug("<cleanup/>"); } cleanup(bootHeap, firstHeap); // Verification if (debug) { if (verbose) { Unsafe.debug("<verify/>"); } verify(bootHeap, firstHeap); } } finally { heapManager.setGcActive(false); heapManager.resetCurrentHeap(); helper.restartThreads(); } // Start the finalization process heapManager.triggerFinalization(); if (verbose) { Unsafe.debug("</gc free="); Unsafe.debug(heapManager.getFreeMemory()); Unsafe.debug("/>"); if (debug) { System.out.println(stats); } } }
final void gc() { // Prepare final VmBootHeap bootHeap = heapManager.getBootHeap(); final VmAbstractHeap firstHeap = heapManager.getHeapList(); stats.lastGCTime = System.currentTimeMillis(); final boolean locking = (writeBarrier != null); final boolean verbose = debug; helper.stopThreadsAtSafePoint(); heapManager.setGcActive(true); try { // Mark //helper.stopThreadsAtSafePoint(); //heapManager.setGcActive(true); try { if (verbose) { Unsafe.debug("<mark/>"); } markHeap(bootHeap, firstHeap, locking); } finally { //heapManager.setGcActive(false); //helper.restartThreads(); } // Sweep if (verbose) { Unsafe.debug("<sweep/>"); } sweep(firstHeap); // Cleanup if (verbose) { Unsafe.debug("<cleanup/>"); } cleanup(bootHeap, firstHeap); // Verification if (debug) { if (verbose) { Unsafe.debug("<verify/>"); } verify(bootHeap, firstHeap); } } finally { heapManager.setGcActive(false); heapManager.resetCurrentHeap(); helper.restartThreads(); } // Start the finalization process heapManager.triggerFinalization(); if (verbose) { Unsafe.debug("</gc free="); Unsafe.debug(heapManager.getFreeMemory()); Unsafe.debug("/>"); if (debug) { System.out.println(stats); } } }
7,659
private final void markHeap(VmBootHeap bootHeap, VmAbstractHeap firstHeap, boolean locking) { if (writeBarrier != null) { writeBarrier.setActive(true); } final long startTime = VmSystem.currentKernelMillis(); long markedObjects = 0; boolean firstIteration = true; boolean wbChanged = false; do { // Do an iteration reset markStack.reset(); if (writeBarrier != null) { writeBarrier.resetChanged(); } markVisitor.reset(); markVisitor.setRootSet(true); statics.walk(markVisitor, resolver); // Mark every object in the rootset bootHeap.walk(markVisitor, locking, 0, 0); if (!firstIteration) { // If there was an overflow in the last iteration, // we must also walk through the other heap to visit // all grey objects, since we must still mark // their children. markVisitor.setRootSet(false); VmAbstractHeap heap = firstHeap; while ((heap != null) && (!markStack.isOverflow())) { heap.walk(markVisitor, locking, 0, 0); heap = heap.getNext(); } } // Test for an endless loop if ((markVisitor.getMarkedObjects() == 0) && markStack.isOverflow()) { // Oops... an endless loop Unsafe.debug("Endless loop in markHeap.... going to die"); helper.die("GCManager.markHeap"); } // Do some cleanup markedObjects += markVisitor.getMarkedObjects(); firstIteration = false; if (writeBarrier != null) { wbChanged = writeBarrier.isChanged(); } } while (markStack.isOverflow() || wbChanged); final long endTime = VmSystem.currentKernelMillis(); stats.lastMarkDuration = endTime - startTime; stats.lastMarkedObjects = markedObjects; if (writeBarrier != null) { writeBarrier.setActive(false); } }
private final void markHeap(VmBootHeap bootHeap, VmAbstractHeap firstHeap, boolean locking) { if (writeBarrier != null) { writeBarrier.setActive(true); } final long startTime = VmSystem.currentKernelMillis(); long markedObjects = 0; boolean firstIteration = true; boolean wbChanged = false; do { // Do an iteration reset markStack.reset(); if (writeBarrier != null) { writeBarrier.resetChanged(); } markVisitor.reset(); markVisitor.setRootSet(true); statics.walk(markVisitor, resolver); // Mark every object in the rootset bootHeap.walk(markVisitor, locking, 0, 0); if (!firstIteration) { // If there was an overflow in the last iteration, // we must also walk through the other heap to visit // all grey objects, since we must still mark // their children. markVisitor.setRootSet(false); VmAbstractHeap heap = firstHeap; while ((heap != null) && (!markStack.isOverflow())) { heap.walk(markVisitor, locking, 0, 0); heap = heap.getNext(); } } // Test for an endless loop if ((markVisitor.getMarkedObjects() == 0) && markStack.isOverflow()) { // Oops... an endless loop Unsafe.debug("Endless loop in markHeap.... going to die"); helper.die("GCManager.markHeap"); } // Do some cleanup markedObjects += markVisitor.getMarkedObjects(); firstIteration = false; if (writeBarrier != null) { wbChanged = writeBarrier.isChanged(); } } while (markStack.isOverflow() || wbChanged); final long endTime = VmSystem.currentKernelMillis(); stats.lastMarkDuration = endTime - startTime; stats.lastMarkedObjects = markedObjects; if (writeBarrier != null) { writeBarrier.setActive(false); } }
7,660
private final void doExecute() throws BuildException { debug = (getProject().getProperty("jnode.debug") != null); final long lmJar = jarFile.lastModified(); final long lmKernel = kernelFile.lastModified(); final long lmDest = destFile.lastModified(); final long lmPIL = getPluginListFile().lastModified(); final PluginList piList; final long lmPI; try { log("plugin-list: " + getPluginListFile(), Project.MSG_DEBUG); piList = getPluginList(); lmPI = piList.lastModified(); } catch (PluginException ex) { throw new BuildException(ex); } catch (IOException ex) { throw new BuildException(ex); } if ((lmJar < lmDest) && (lmKernel < lmDest) && (lmPIL < lmDest) && (lmPI < lmDest)) { // No need to do anything, skip return; } if (debugFile != null) { debugFile.delete(); } try { System.getProperties().setProperty(BUILDTIME_PROPERTY, "1"); // Load the plugin descriptors final PluginRegistry piRegistry; piRegistry = new PluginRegistryModel(piList.getPluginList()); //piRegistry = new // PluginRegistryModel(piList.getDescriptorUrlList()); testPluginPrerequisites(piRegistry); /* Now create the processor */ final VmArchitecture arch = getArchitecture(); final NativeStream os = createNativeStream(); clsMgr = new VmSystemClassLoader(classesURL, arch, new BuildObjectResolver(os, this)); blockedObjects.add(clsMgr); blockedObjects.add(clsMgr.getStatics()); blockedObjects.add(clsMgr.getStatics().getTable()); if (debug) { log("Building in DEBUG mode", Project.MSG_WARN); } // Create the VM final HeapHelper helper = new HeapHelperImpl(arch); final Vm vm = new Vm(arch, new DefaultHeapManager(clsMgr, helper, clsMgr.getStatics()), clsMgr.getStatics(), debug); blockedObjects.add(vm); final VmProcessor proc = createProcessor(clsMgr.getStatics()); log("Building for " + proc.getCPUID()); final Label clInitCaller = new Label("$$clInitCaller"); VmType systemClasses[] = VmType.initializeForBootImage(clsMgr); for (int i = 0; i < systemClasses.length; i++) { clsMgr.addLoadedClass(systemClasses[ i].getName(), systemClasses[ i]); } // First copy the native kernel file copyKernel(os); os.setObjectRef(bootHeapStart); // Setup a call to our first java method initImageHeader(os, clInitCaller, vm, piRegistry); // Create the initial stack createInitialStack(os, initialStack, initialStackPtr); /* Now load the classes */ loadClass(VmMethodCode.class); loadClass(Unsafe.class); loadClass(VmSystemClassLoader.class); loadClass(VmType[].class); loadClass(Vm.class); loadClass(VmBootHeap.class); loadClass(VmDefaultHeap.class); loadClass(VmHeapManager.class); loadClass(VmStatics.class); loadClass(vm.getHeapManager().getClass()); loadClass(HeapHelper.class); loadClass(HeapHelperImpl.class); loadSystemClasses(); /* Now emit the processor */ os.getObjectRef(proc); /* Let the compilers load its native symbol offsets */ final NativeCodeCompiler[] cmps = arch.getCompilers(); for (int i = 0; i < cmps.length; i++) { final NativeCodeCompiler cmp = cmps[ i]; cmp.initialize(clsMgr); os.getObjectRef(cmp); } // Load the jarfile as byte-array copyJarFile(os); // Now emit all object images to the actual image emitObjects(os, arch, blockedObjects); // Disallow the loading of new classes clsMgr.setFailOnNewLoad(true); emitObjects(os, arch, blockedObjects); // Emit the classmanager log("Emit vm", Project.MSG_VERBOSE); blockedObjects.remove(vm); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); /* Set the bootclasses */ log("prepare bootClassArray", Project.MSG_VERBOSE); final VmType bootClasses[] = clsMgr.prepareAfterBootstrap(); os.getObjectRef(bootClasses); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); // Emit the classmanager log("Emit clsMgr", Project.MSG_VERBOSE); // Turn auto-compilation on clsMgr.setCompileRequired(); blockedObjects.remove(clsMgr); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); // Emit the classmanager log("Emit statics", Project.MSG_VERBOSE); blockedObjects.remove(clsMgr.getStatics()); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); // Emit the remaining objects log("Emit rest; blocked=" + blockedObjects, Project.MSG_VERBOSE); emitObjects(os, arch, null); log("statics table 0x" + NumberUtils.hex(os.getObjectRef( clsMgr.getStatics().getTable()).getOffset()), Project.MSG_VERBOSE); /* Write static initializer code */ emitStaticInitializerCalls(os, bootClasses, clInitCaller); // This is the end of the image X86Stream.ObjectInfo dummyObjectAtEnd = os .startObject(loadClass(VmMethodCode.class)); pageAlign(os); dummyObjectAtEnd.markEnd(); os.setObjectRef(imageEnd); os.setObjectRef(bootHeapEnd); /* Link all native symbols */ linkNativeSymbols(os); // Patch multiboot header patchHeader(os); // Store the image storeImage(os); // Generate the listfile printLabels(os, bootClasses, clsMgr.getStatics()); // Generate debug info for (int i = 0; i < cmps.length; i++) { cmps[ i].dumpStatistics(); } final int bootHeapSize = os.getObjectRef(bootHeapEnd).getOffset() - os.getObjectRef(bootHeapStart).getOffset(); final int bootHeapBitmapSize = (bootHeapSize / ObjectLayout.OBJECT_ALIGN) >> 3; log("Boot heap size " + (bootHeapSize >>> 10) + "K bitmap size " + (bootHeapBitmapSize >>> 10) + "K"); clsMgr.getStatics().dumpStatistics(System.out); logStatistics(os); BytecodeParser.dumpStatistics(); log("Optimized methods : " + totalHighMethods + ", avg size " + (totalHighMethodSize / totalHighMethods) + ", tot size " + totalHighMethodSize); log("Ondemand comp. methods: " + totalLowMethods + ", avg size " + (totalLowMethodSize / totalLowMethods) + ", tot size " + totalLowMethodSize); log("Done."); os.clear(); } catch (Throwable ex) { ex.printStackTrace(); throw new BuildException(ex); } }
private final void doExecute() throws BuildException { debug = (getProject().getProperty("jnode.debug") != null); final long lmJar = jarFile.lastModified(); final long lmKernel = kernelFile.lastModified(); final long lmDest = destFile.lastModified(); final long lmPIL = getPluginListFile().lastModified(); final PluginList piList; final long lmPI; try { log("plugin-list: " + getPluginListFile(), Project.MSG_DEBUG); piList = getPluginList(); lmPI = piList.lastModified(); } catch (PluginException ex) { throw new BuildException(ex); } catch (IOException ex) { throw new BuildException(ex); } if ((lmJar < lmDest) && (lmKernel < lmDest) && (lmPIL < lmDest) && (lmPI < lmDest)) { // No need to do anything, skip return; } if (debugFile != null) { debugFile.delete(); } try { System.getProperties().setProperty(BUILDTIME_PROPERTY, "1"); // Load the plugin descriptors final PluginRegistry piRegistry; piRegistry = new PluginRegistryModel(piList.getPluginList()); //piRegistry = new // PluginRegistryModel(piList.getDescriptorUrlList()); testPluginPrerequisites(piRegistry); /* Now create the processor */ final VmArchitecture arch = getArchitecture(); final NativeStream os = createNativeStream(); clsMgr = new VmSystemClassLoader(classesURL, arch, new BuildObjectResolver(os, this)); blockedObjects.add(clsMgr); blockedObjects.add(clsMgr.getStatics()); blockedObjects.add(clsMgr.getStatics().getTable()); if (debug) { log("Building in DEBUG mode", Project.MSG_WARN); } // Create the VM final HeapHelper helper = new HeapHelperImpl(arch); final Vm vm = new Vm(version, arch, new DefaultHeapManager(clsMgr, helper, clsMgr.getStatics()), clsMgr.getStatics(), debug); blockedObjects.add(vm); final VmProcessor proc = createProcessor(clsMgr.getStatics()); log("Building for " + proc.getCPUID()); final Label clInitCaller = new Label("$$clInitCaller"); VmType systemClasses[] = VmType.initializeForBootImage(clsMgr); for (int i = 0; i < systemClasses.length; i++) { clsMgr.addLoadedClass(systemClasses[ i].getName(), systemClasses[ i]); } // First copy the native kernel file copyKernel(os); os.setObjectRef(bootHeapStart); // Setup a call to our first java method initImageHeader(os, clInitCaller, vm, piRegistry); // Create the initial stack createInitialStack(os, initialStack, initialStackPtr); /* Now load the classes */ loadClass(VmMethodCode.class); loadClass(Unsafe.class); loadClass(VmSystemClassLoader.class); loadClass(VmType[].class); loadClass(Vm.class); loadClass(VmBootHeap.class); loadClass(VmDefaultHeap.class); loadClass(VmHeapManager.class); loadClass(VmStatics.class); loadClass(vm.getHeapManager().getClass()); loadClass(HeapHelper.class); loadClass(HeapHelperImpl.class); loadSystemClasses(); /* Now emit the processor */ os.getObjectRef(proc); /* Let the compilers load its native symbol offsets */ final NativeCodeCompiler[] cmps = arch.getCompilers(); for (int i = 0; i < cmps.length; i++) { final NativeCodeCompiler cmp = cmps[ i]; cmp.initialize(clsMgr); os.getObjectRef(cmp); } // Load the jarfile as byte-array copyJarFile(os); // Now emit all object images to the actual image emitObjects(os, arch, blockedObjects); // Disallow the loading of new classes clsMgr.setFailOnNewLoad(true); emitObjects(os, arch, blockedObjects); // Emit the classmanager log("Emit vm", Project.MSG_VERBOSE); blockedObjects.remove(vm); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); /* Set the bootclasses */ log("prepare bootClassArray", Project.MSG_VERBOSE); final VmType bootClasses[] = clsMgr.prepareAfterBootstrap(); os.getObjectRef(bootClasses); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); // Emit the classmanager log("Emit clsMgr", Project.MSG_VERBOSE); // Turn auto-compilation on clsMgr.setCompileRequired(); blockedObjects.remove(clsMgr); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); // Emit the classmanager log("Emit statics", Project.MSG_VERBOSE); blockedObjects.remove(clsMgr.getStatics()); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); // Emit the remaining objects log("Emit rest; blocked=" + blockedObjects, Project.MSG_VERBOSE); emitObjects(os, arch, null); log("statics table 0x" + NumberUtils.hex(os.getObjectRef( clsMgr.getStatics().getTable()).getOffset()), Project.MSG_VERBOSE); /* Write static initializer code */ emitStaticInitializerCalls(os, bootClasses, clInitCaller); // This is the end of the image X86Stream.ObjectInfo dummyObjectAtEnd = os .startObject(loadClass(VmMethodCode.class)); pageAlign(os); dummyObjectAtEnd.markEnd(); os.setObjectRef(imageEnd); os.setObjectRef(bootHeapEnd); /* Link all native symbols */ linkNativeSymbols(os); // Patch multiboot header patchHeader(os); // Store the image storeImage(os); // Generate the listfile printLabels(os, bootClasses, clsMgr.getStatics()); // Generate debug info for (int i = 0; i < cmps.length; i++) { cmps[ i].dumpStatistics(); } final int bootHeapSize = os.getObjectRef(bootHeapEnd).getOffset() - os.getObjectRef(bootHeapStart).getOffset(); final int bootHeapBitmapSize = (bootHeapSize / ObjectLayout.OBJECT_ALIGN) >> 3; log("Boot heap size " + (bootHeapSize >>> 10) + "K bitmap size " + (bootHeapBitmapSize >>> 10) + "K"); clsMgr.getStatics().dumpStatistics(System.out); logStatistics(os); BytecodeParser.dumpStatistics(); log("Optimized methods : " + totalHighMethods + ", avg size " + (totalHighMethodSize / totalHighMethods) + ", tot size " + totalHighMethodSize); log("Ondemand comp. methods: " + totalLowMethods + ", avg size " + (totalLowMethodSize / totalLowMethods) + ", tot size " + totalLowMethodSize); log("Done."); os.clear(); } catch (Throwable ex) { ex.printStackTrace(); throw new BuildException(ex); } }
7,661
protected void paintFocus(Graphics g, Rectangle t, Dimension d) { g.setColor(focusColor); g.drawRect(t.x, t.y, t.width, t.height); // FIXME: we seem to be drawing too tight a rectangle here, perhaps there // is some padding to do somewhere??? }
protected void paintFocus(Graphics g, Rectangle t, Dimension d) { g.setColor(focusColor); g.drawRect(t.x, t.y, t.width - 2, t.height - 2); // FIXME: we seem to be drawing too tight a rectangle here, perhaps there // is some padding to do somewhere??? }
7,662
public void paint(Graphics g, JComponent c) { AbstractButton b = (AbstractButton) c; Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle(); Font f = c.getFont(); g.setFont(f); Icon currentIcon = null; if (b.isSelected() && b.isEnabled()) currentIcon = b.getSelectedIcon(); else if (!b.isSelected() && b.isEnabled()) currentIcon = b.getIcon(); else if (b.isSelected() && !b.isEnabled()) currentIcon = b.getDisabledSelectedIcon(); else // (!b.isSelected() && !b.isEnabled()) currentIcon = b.getDisabledIcon(); SwingUtilities.calculateInnerArea(b, vr); String text = SwingUtilities.layoutCompoundLabel (c, g.getFontMetrics(f), b.getText(), currentIcon, b.getVerticalAlignment(), b.getHorizontalAlignment(), b.getVerticalTextPosition(), b.getHorizontalTextPosition(), vr, ir, tr, b.getIconTextGap() + defaultTextShiftOffset); if (currentIcon != null) { currentIcon.paintIcon(c, g, ir.x, ir.y); } if (text != null) paintText(g, b, tr, text); // TODO: Figure out what is the size parameter? if (b.hasFocus() && b.isFocusPainted()) paintFocus(g, tr, null); }
public void paint(Graphics g, JComponent c) { AbstractButton b = (AbstractButton) c; Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle(); Font f = c.getFont(); g.setFont(f); Icon currentIcon = null; if (b.isSelected() && b.isEnabled()) currentIcon = b.getSelectedIcon(); else if (!b.isSelected() && b.isEnabled()) currentIcon = b.getIcon(); else if (b.isSelected() && !b.isEnabled()) currentIcon = b.getDisabledSelectedIcon(); else // (!b.isSelected() && !b.isEnabled()) currentIcon = b.getDisabledIcon(); SwingUtilities.calculateInnerArea(b, vr); String text = SwingUtilities.layoutCompoundLabel (c, g.getFontMetrics(f), b.getText(), currentIcon, b.getVerticalAlignment(), b.getHorizontalAlignment(), b.getVerticalTextPosition(), b.getHorizontalTextPosition(), vr, ir, tr, b.getIconTextGap() + defaultTextShiftOffset); if (currentIcon != null) { currentIcon.paintIcon(c, g, ir.x, ir.y); } if (text != null) paintText(g, b, tr, text); // TODO: Figure out what is the size parameter? if (b.hasFocus() && b.isFocusPainted() && b.isEnabled()) paintFocus(g, tr, null); }
7,663
protected void init() { super.init(); classXDFNodeName = "field"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0, NOTELIST_XML_ATTRIBUTE_NAME); attribOrder.add(0, RELATION_XML_ATTRIBUTE_NAME); attribOrder.add(0, UNITS_XML_ATTRIBUTE_NAME); attribOrder.add(0, DATAFORMAT_XML_ATTRIBUTE_NAME); attribOrder.add(0, DISABLEDVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, UNDERFLOWVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, OVERFLOWVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, NOTANUMBERVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, NODATAVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, INFINITENEGATIVEVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, INFINITEVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, GREATERTHANOREQUALVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, GREATERTHANVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, LESSTHANOREQUALVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, LESSTHANVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, CLASS_XML_ATTRIBUTE_NAME); attribOrder.add(0, IDREF_XML_ATTRIBUTE_NAME); attribOrder.add(0, ID_XML_ATTRIBUTE_NAME); attribOrder.add(0, DESCRIPTION_XML_ATTRIBUTE_NAME); attribOrder.add(0, NAME_XML_ATTRIBUTE_NAME); //set up the attribute hashtable key with the default initial value attribHash.put(NOTELIST_XML_ATTRIBUTE_NAME, new Attribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); attribHash.put(RELATION_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.OBJECT_TYPE)); //double check attribHash.put(UNITS_XML_ATTRIBUTE_NAME, new Attribute(new Units(), Constants.OBJECT_TYPE)); attribHash.put(DATAFORMAT_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.OBJECT_TYPE)); attribHash.put(CLASS_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(DISABLEDVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(OVERFLOWVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(UNDERFLOWVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(NOTANUMBERVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(NODATAVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(INFINITENEGATIVEVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(INFINITEVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(GREATERTHANOREQUALVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(GREATERTHANVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(LESSTHANOREQUALVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(LESSTHANVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(IDREF_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(ID_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(DESCRIPTION_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(NAME_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); };
protected void init() { super.init(); classXDFNodeName = "field"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0, NOTELIST_XML_ATTRIBUTE_NAME); attribOrder.add(0, RELATION_XML_ATTRIBUTE_NAME); attribOrder.add(0, UNITS_XML_ATTRIBUTE_NAME); attribOrder.add(0, DISABLEDVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, UNDERFLOWVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, OVERFLOWVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, NOTANUMBERVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, NODATAVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, INFINITENEGATIVEVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, INFINITEVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, GREATERTHANOREQUALVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, GREATERTHANVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, LESSTHANOREQUALVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, LESSTHANVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, CLASS_XML_ATTRIBUTE_NAME); attribOrder.add(0, IDREF_XML_ATTRIBUTE_NAME); attribOrder.add(0, ID_XML_ATTRIBUTE_NAME); attribOrder.add(0, DESCRIPTION_XML_ATTRIBUTE_NAME); attribOrder.add(0, NAME_XML_ATTRIBUTE_NAME); //set up the attribute hashtable key with the default initial value attribHash.put(NOTELIST_XML_ATTRIBUTE_NAME, new Attribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); attribHash.put(RELATION_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.OBJECT_TYPE)); //double check attribHash.put(UNITS_XML_ATTRIBUTE_NAME, new Attribute(new Units(), Constants.OBJECT_TYPE)); attribHash.put(DATAFORMAT_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.OBJECT_TYPE)); attribHash.put(CLASS_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(DISABLEDVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(OVERFLOWVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(UNDERFLOWVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(NOTANUMBERVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(NODATAVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(INFINITENEGATIVEVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(INFINITEVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(GREATERTHANOREQUALVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(GREATERTHANVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(LESSTHANOREQUALVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(LESSTHANVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(IDREF_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(ID_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(DESCRIPTION_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(NAME_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); };
7,664
public synchronized void read(BlockDeviceAPI device, long offset) throws IOException { byte[] data = new byte[entries.size() * 32]; device.read(offset, data, 0, data.length); //System.out.println("Directory at offset :" + offset); //System.out.println("Length in bytes = " + entries.size() * 32); read(data); resetDirty(); }
public synchronized void read(BlockDeviceAPI device, long offset) throws IOException { byte[] data = new byte[entries.size() * 32]; device.read(offset, data, 0, data.length); //System.out.println("Directory at offset :" + offset); //System.out.println("Length in bytes = " + entries.size() * 32); read(data); resetDirty(); }
7,666
public void commitEdit() throws ParseException { } /* TODO */
public void commitEdit() throws ParseException { } /* TODO */
7,668
public void commitEdit() throws ParseException { } /* TODO */
public void commitEdit() throws ParseException { } /* TODO */
7,669
public void propertyChange(PropertyChangeEvent event) { } /* TODO */
public void propertyChange(PropertyChangeEvent event) { } /* TODO */
7,670
public void stateChanged(ChangeEvent event) { } /* TODO */
public void stateChanged(ChangeEvent event) { } /* TODO */
7,672
public void run() { try { // System.err.println("Registering shell in new thread."); ShellUtils.getShellManager().registerShell(commandShell);//workaround // to // ensure // access // to // the // command // shell // in // this // new // thread? try { AccessController.doPrivileged(new InvokeAction(method, null, args)); } catch (PrivilegedActionException ex) { throw ex.getException(); } if (!isBlocking()) { //somebody already hit ctrl-c. } else { finished = true; // System.err.println("Finished invocation, notifying // blockers."); //done with invoke, stop waiting for a ctrl-c unblock(); } } catch (InvocationTargetException ex) { Throwable tex = ex.getTargetException(); if (tex instanceof SyntaxError) { Help.getInfo(cx).usage(); err.println(tex.getMessage()); unblock(); } else { err.println("Exception in command"); tex.printStackTrace(err); unblock(); } } catch (Exception ex) { err.println("Exception in command"); ex.printStackTrace(err); unblock(); } finished = true; }
public void run() { try { // System.err.println("Registering shell in new thread."); ShellUtils.getShellManager().registerShell(commandShell);//workaround // to // ensure // access // to // the // command // shell // in // this // new // thread? try { AccessController.doPrivileged(new InvokeAction(method, null, args)); } catch (PrivilegedActionException ex) { throw ex.getException(); } if (!isBlocking()) { //somebody already hit ctrl-c. } else { finished = true; // System.err.println("Finished invocation, notifying // blockers."); //done with invoke, stop waiting for a ctrl-c unblock(); } } catch (InvocationTargetException ex) { Throwable tex = ex.getTargetException(); if (tex instanceof SyntaxError) { Help.getInfo(cx).usage(); err.println(tex.getMessage()); unblock(); } else { err.println("Exception in command"); tex.printStackTrace(err); unblock(); } } catch (Exception ex) { err.println("Exception in command"); ex.printStackTrace(err); unblock(); } finished = true; }
7,673
public static Point convertPoint(Component source, int x, int y, Component destination) { Point pt = new Point(x, y); if (source == null && destination == null) return pt; if (source == null) source = getRoot(destination); if (destination == null) destination = getRoot(source); if (source.isShowing() && destination.isShowing()) { convertPointToScreen(pt, source); convertPointFromScreen(pt, destination); } return pt; }
public static Point convertPoint(Component source, int x, int y, Component destination) { Point pt = new Point(x, y); if (source == null && destination == null) return pt; if (source == null) source = getRoot(destination); if (destination == null) destination = getRoot(source); if (source.isShowing() && destination.isShowing()) { convertPointToScreen(pt, source); convertPointFromScreen(pt, destination); } return pt; }
7,674
public Ext2Entry(INode iNode, String name, int type) { this.iNode = iNode; this.name = name; this.type = type; this.valid = true; Ext2Debugger.debug("Ext2Entry(iNode, name): name="+name+ (isDirectory()?" is a directory ":"")+ (isFile()?" is a file ":""), 2); }
public Ext2Entry(INode iNode, String name, int type) { this.iNode = iNode; this.name = name; this.type = type; this.valid = true; Ext2Debugger.debug("Ext2Entry(iNode, name): name="+name+ (isDirectory()?" is a directory ":"")+ (isFile()?" is a file ":""), 2); }
7,676
public Ext2Entry(INode iNode, String name, int type) { this.iNode = iNode; this.name = name; this.type = type; this.valid = true; Ext2Debugger.debug("Ext2Entry(iNode, name): name="+name+ (isDirectory()?" is a directory ":"")+ (isFile()?" is a file ":""), 2); }
public Ext2Entry(INode iNode, String name, int type) { this.iNode = iNode; this.name = name; this.type = type; this.valid = true; Ext2Debugger.debug("Ext2Entry(iNode, name): name="+name+ (isDirectory()?" is a directory ":"")+ (isFile()?" is a file ":""), 2); }
7,677
public void doDefaultCloseAction() { fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_CLOSING); switch (getDefaultCloseOperation()) { case HIDE_ON_CLOSE: hide(); break; case DISPOSE_ON_CLOSE: dispose(); break; } }
public void doDefaultCloseAction() { fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_CLOSING); switch (getDefaultCloseOperation()) { case HIDE_ON_CLOSE: hide(); break; case DISPOSE_ON_CLOSE: dispose(); break; } }
7,683
public VariableRefAssignQuad(int address, IRBasicBlock block, int lhsIndex, int rhsIndex) { super(address, block, lhsIndex); this.rhs = getOperand(rhsIndex); refs = new Operand[] { rhs }; setDeadCode(true); }
public VariableRefAssignQuad(int address, IRBasicBlock block, int lhsIndex, int rhsIndex) { super(address, block, lhsIndex); this.rhs = getOperand(rhsIndex); refs = new Operand[] { rhs }; setDeadCode(true); }
7,684
public void doPass2(BootableHashMap liveVariables) { setDeadCode(true); if (rhs instanceof Variable) { Variable v = (Variable) rhs; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } }
public void doPass2(BootableHashMap liveVariables) { setDeadCode(true); if (rhs instanceof Variable) { Variable v = (Variable) rhs; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } }
7,685
public Operand getRHS() { return rhs; }
public Operand getRHS() { return rhs; }
7,686
public Operand propagate(Variable operand) { return rhs; }
public Operand propagate(Variable operand) { return rhs; }
7,687
public String toString() { return getAddress() + ": " + getLHS().toString() + " = " + rhs.toString(); }
public String toString() { return getAddress() + ": " + getLHS().toString() + " = " + rhs.toString(); }
7,688
protected boolean gotoField(ScreenField f) { if (f != null) { goto_XY(f.startPos()); return true; } else { return false; } }
protected boolean gotoField(ScreenField f) { if (f != null) { goto_XY(f.startPos()); return true; } else { return false; } }
7,689
protected boolean gotoField(ScreenField f) { if (f != null) { goto_XY(f.startPos()); return true; } else { return false; } }
protected boolean gotoField(ScreenField f) { if (f != null) { goto_XY(f.startPos()); return true; } else { return false; } }
7,690
protected boolean gotoField(ScreenField f) { if (f != null) { goto_XY(f.startPos()); return true; } else { return false; } }
protected boolean gotoField(ScreenField f) { if (f != null) { goto_XY(f.startPos()); return true; } else { return false; } }
7,691
public SwingTextAreaPeer(TextArea textArea) { super(); switch (textArea.getScrollbarVisibility()) { case TextArea.SCROLLBARS_BOTH: SwingToolkit.add(textArea, new JScrollPane(this, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS)); break; case TextArea.SCROLLBARS_HORIZONTAL_ONLY: SwingToolkit.add(textArea, new JScrollPane(this, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS)); break; case TextArea.SCROLLBARS_VERTICAL_ONLY: SwingToolkit.add(textArea, new JScrollPane(this, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); break; case TextArea.SCROLLBARS_NONE: SwingToolkit.add(textArea, this); break; } SwingToolkit.copyAwtProperties(textArea, this); setText(textArea.getText()); setRows(textArea.getRows()); setColumns(textArea.getColumns()); setEditable(textArea.isEditable()); }
public SwingTextAreaPeer(TextArea textArea) { super(); switch (textArea.getScrollbarVisibility()) { case TextArea.SCROLLBARS_BOTH: SwingToolkit.add(textArea, new JScrollPane(this, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS)); break; case TextArea.SCROLLBARS_HORIZONTAL_ONLY: SwingToolkit.add(textArea, new JScrollPane(this, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS)); break; case TextArea.SCROLLBARS_VERTICAL_ONLY: SwingToolkit.add(textArea, new JScrollPane(this, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); break; case TextArea.SCROLLBARS_NONE: SwingToolkit.add(textArea, this); break; } SwingToolkit.copyAwtProperties(textArea, this); setText(textArea.getText()); setRows(textArea.getRows()); setColumns(textArea.getColumns()); setEditable(textArea.isEditable()); }
7,694
public float getAlignment(int axis) { // FIXME: This is very likely not 100% correct. Work this out. return 0.0F; }
public float getAlignment(int axis) { // FIXME: This is very likely not 100% correct. Work this out. float align; if (axis == X_AXIS) align = 0.0F; else align = super.getAlignment(axis); return align; }
7,695
public float getAlignment(int axis) { if (axis == X_AXIS) return 0.0F; else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); return (firstRowHeight / 2.F) / prefHeight; } else return 0.0F; }
public float getAlignment(int axis) { if (axis == X_AXIS) align = super.getAlignment(axis); else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); return (firstRowHeight / 2.F) / prefHeight; } else align = super.getAlignment(axis); }
7,696
public float getAlignment(int axis) { if (axis == X_AXIS) return 0.0F; else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); return (firstRowHeight / 2.F) / prefHeight; } else return 0.0F; }
publicfloatgetAlignment(intaxis){if(axis==X_AXIS)return0.0F;elseif(getViewCount()>0){floatprefHeight=getPreferredSpan(Y_AXIS);floatfirstRowHeight=getView(0).getPreferredSpan(Y_AXIS);return(firstRowHeight/2.F)/prefHeight;}elsereturn0.0F;}
7,697
public float getAlignment(int axis) { if (axis == X_AXIS) return 0.0F; else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); return (firstRowHeight / 2.F) / prefHeight; } else return 0.0F; }
public float getAlignment(int axis) { if (axis == X_AXIS) return 0.0F; else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); align = (firstRowHeight / 2.F) / prefHeight; } else return 0.0F; }
7,698
public float getAlignment(int axis) { if (axis == X_AXIS) return 0.0F; else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); return (firstRowHeight / 2.F) / prefHeight; } else return 0.0F; }
public float getAlignment(int axis) { if (axis == X_AXIS) align = 0.0F; return align; else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); return (firstRowHeight / 2.F) / prefHeight; } else align = 0.0F; return align; }
7,699
public int[] getSizes() { // Variables int[] array; int index; // Create New Array array = new int[sizes.length]; for (index = 0; index < sizes.length; index++) { array[index] = sizes[index]; } // for // Return Newly created array return array; } // getSizes()
public int[] getSizes() { // Variables int[] array; int index; // Create New Array array = new int[sizes.length]; for (index = 0; index < sizes.length; index++) { array[index] = sizes[index]; } // for // Return Newly created array return array; } // getSizes()
7,700
public int[] getSizes() { // Variables int[] array; int index; // Create New Array array = new int[sizes.length]; for (index = 0; index < sizes.length; index++) { array[index] = sizes[index]; } // for // Return Newly created array return array; } // getSizes()
public int[] getSizes() { // Variables int[] array; int index; // Create New Array array = new int[sizes.length]; for (index = 0; index < sizes.length; index++) { array[index] = sizes[index]; } // for // Return Newly created array return array; } // getSizes()
7,701
public int[] getSizes() { // Variables int[] array; int index; // Create New Array array = new int[sizes.length]; for (index = 0; index < sizes.length; index++) { array[index] = sizes[index]; } // for // Return Newly created array return array; } // getSizes()
public int[] getSizes() { // Variables int[] array; int index; // Create New Array array = new int[sizes.length]; for (index = 0; index < sizes.length; index++) { array[index] = sizes[index]; } // for // Return Newly created array return array; } // getSizes()
7,702
public int[] getSizes() { // Variables int[] array; int index; // Create New Array array = new int[sizes.length]; for (index = 0; index < sizes.length; index++) { array[index] = sizes[index]; } // for // Return Newly created array return array; } // getSizes()
public int[] getSizes() { // Variables int[] array; int index; // Create New Array array = new int[sizes.length]; for (index = 0; index < sizes.length; index++) { array[index] = sizes[index]; } // for // Return Newly created array return array; } // getSizes()
7,703
public void setSizes(int[] sizes) { // Variables int index; // Initialize Sizes this.sizes = new int[sizes.length]; for (index = 0; index < sizes.length; index++) { this.sizes[index] = sizes[index]; } // for } // setSizes()
public void setSizes(int[] sizes) { // Variables int index; // Initialize Sizes this.sizes = new int[sizes.length]; for (index = 0; index < sizes.length; index++) { this.sizes[index] = sizes[index]; } // for } // setSizes()
7,704
public void setSizes(int[] sizes) { // Variables int index; // Initialize Sizes this.sizes = new int[sizes.length]; for (index = 0; index < sizes.length; index++) { this.sizes[index] = sizes[index]; } // for } // setSizes()
public void setSizes(int[] sizes) { // Variables int index; // Initialize Sizes this.sizes = new int[sizes.length]; for (index = 0; index < sizes.length; index++) { this.sizes[index] = sizes[index]; } // for } // setSizes()
7,705
public void init(TestConfig config, MockObjectTestCase testCase) throws IOException { // set the current testCase for our factory MockFloppyDeviceFactory factory = (MockFloppyDeviceFactory) FSDriverUtils.getFloppyDeviceFactory(); factory.setTestCase((MockObjectTestCase) testCase); DeviceFinder deviceFinder = new FloppyControllerFinder(); StubDeviceManager.INSTANCE.removeAll(); StubDeviceManager.INSTANCE.add(deviceFinder, new FloppyDeviceToDriverMapper()); FloppyDriver driver = (FloppyDriver) findDriver(deviceFinder, "fd0"); log.debug("findDriver->"+driver); init(null, driver, null); }
public void init(TestConfig config, MockObjectTestCase testCase) throws IOException { // set the current testCase for our factory MockFloppyDeviceFactory factory = (MockFloppyDeviceFactory) FSDriverUtils.getFloppyDeviceFactory(); factory.setTestCase((MockObjectTestCase) testCase); DeviceFinder deviceFinder = new FloppyControllerFinder(); StubDeviceManager.INSTANCE.removeAll(); StubDeviceManager.INSTANCE.add(deviceFinder, new FloppyDeviceToDriverMapper()); FloppyDriver driver = (FloppyDriver) findDriver(deviceFinder, "fd0"); log.debug("findDriver->"+driver); init(null, driver, null); }
7,706
public byte[] getEncoded() { return getEncoded(IKeyPairCodec.RAW_FORMAT); }
public byte[] getEncoded() { return getEncoded(defaultFormat); }
7,707
public String getFormat() { return KeyPairCodecFactory.getEncodingShortName(defaultFormat); }
public String getFormat() { return FormatUtil.getEncodingShortName(defaultFormat); }
7,708
public UShortSeqHolder(short[] initial_value) { value = initial_value; typecode.setLength(value.length); }
public UShortSeqHolder() { value = initial_value; typecode.setLength(value.length); }
7,709
public UShortSeqHolder(short[] initial_value) { value = initial_value; typecode.setLength(value.length); }
public UShortSeqHolder(short[] initial_value) { value = initial_value; typecode.setLength(value.length); }
7,710
public void init() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } }
public void init() { try { jbInit(); } catch(Exception e) { log.warn("In constructor: ", e); } }
7,712
private boolean isSpecified(String parm) { if (getParameter(parm) != null) { System.out.println("Parameter " + parm + " is specified as: " + getParameter(parm)); return true; } return false; }
private boolean isSpecified(String parm) { if (getParameter(parm) != null) { log.info("Parameter " + parm + " is specified as: " + getParameter(parm)); return true; } return false; }
7,713
private void jbInit() throws Exception { this.setSize(new Dimension(400,300)); Properties sesProps = new Properties(); System.out.println(" We have loaded a new one"); // Start loading properties - Host must exist sesProps.put(SESSION_HOST,getParameter("host")); if (isSpecified("-e")) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p")) { sesProps.put(SESSION_HOST_PORT,getParameter("-p")); }// if (isSpecified("-f",args))// propFileName = getParm("-f",args); if (isSpecified("-cp")) sesProps.put(SESSION_CODE_PAGE ,getParameter("-cp")); if (isSpecified("-gui")) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132")) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // socks proxy host argument if (isSpecified("-sph")) { sesProps.put(SESSION_PROXY_HOST ,getParameter("-sph")); } // socks proxy port argument if (isSpecified("-spp")) sesProps.put(SESSION_PROXY_PORT ,getParameter("-spp")); // check if device name is specified if (isSpecified("-dn")) sesProps.put(SESSION_DEVICE_NAME ,getParameter("-dn")); if (isSpecified("-L")) LangTool.init(parseLocale(getParameter("-L"))); else LangTool.init(); loadSystemProperty("SESSION_CONNECT_USER"); loadSystemProperty("SESSION_CONNECT_PASSWORD"); loadSystemProperty("SESSION_CONNECT_PROGRAM"); loadSystemProperty("SESSION_CONNECT_LIBRARY"); loadSystemProperty("SESSION_CONNECT_MENU"); manager = new SessionManager(); final Session s = manager.openSession(sesProps,"","Test Applet"); this.getContentPane().add(s); s.connect(); SwingUtilities.invokeLater(new Runnable() { public void run() { s.grabFocus(); } }); }
private void jbInit() throws Exception { this.setSize(new Dimension(400,300)); Properties sesProps = new Properties(); log.info(" We have loaded a new one"); // Start loading properties - Host must exist sesProps.put(SESSION_HOST,getParameter("host")); if (isSpecified("-e")) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p")) { sesProps.put(SESSION_HOST_PORT,getParameter("-p")); }// if (isSpecified("-f",args))// propFileName = getParm("-f",args); if (isSpecified("-cp")) sesProps.put(SESSION_CODE_PAGE ,getParameter("-cp")); if (isSpecified("-gui")) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132")) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // socks proxy host argument if (isSpecified("-sph")) { sesProps.put(SESSION_PROXY_HOST ,getParameter("-sph")); } // socks proxy port argument if (isSpecified("-spp")) sesProps.put(SESSION_PROXY_PORT ,getParameter("-spp")); // check if device name is specified if (isSpecified("-dn")) sesProps.put(SESSION_DEVICE_NAME ,getParameter("-dn")); if (isSpecified("-L")) LangTool.init(parseLocale(getParameter("-L"))); else LangTool.init(); loadSystemProperty("SESSION_CONNECT_USER"); loadSystemProperty("SESSION_CONNECT_PASSWORD"); loadSystemProperty("SESSION_CONNECT_PROGRAM"); loadSystemProperty("SESSION_CONNECT_LIBRARY"); loadSystemProperty("SESSION_CONNECT_MENU"); manager = new SessionManager(); final Session s = manager.openSession(sesProps,"","Test Applet"); this.getContentPane().add(s); s.connect(); SwingUtilities.invokeLater(new Runnable() { public void run() { s.grabFocus(); } }); }
7,714
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolygon(bright); g.setColor(Color.BLACK); g.drawPolygon(dark); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolygon(dark); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
7,715
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolygon(bright); g.setColor(Color.BLACK); g.drawPolygon(dark); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolygon(bright); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
7,716
public UndoableEdit insertString(int where, String str) throws BadLocationException { // check arguments int length = length(); int strLen = str.length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); // check if the gap is big enough to hold the string if ((gapEnd - gapStart) < strLen) // make room for this string and some more shiftEnd(strLen + DEFAULT_BUFSIZE); // are we at the gap boundary? if (where != gapStart) shiftGap(where); // now we can simple copy the string into the gap and adjust the // gap boundaries System.arraycopy(str.toCharArray(), 0, buffer, gapStart, strLen); gapStart += strLen; return null; }
public UndoableEdit insertString(int where, String str) throws BadLocationException { // check arguments int length = length(); int strLen = str.length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); // check if the gap is big enough to hold the string if ((gapEnd - gapStart) < strLen) // make room for this string and some more shiftEnd(strLen + DEFAULT_BUFSIZE); // are we at the gap boundary? if (where != gapStart) shiftGap(where); // now we can simple copy the string into the gap and adjust the // gap boundaries System.arraycopy(str.toCharArray(), 0, buffer, gapStart, strLen); gapStart += strLen; return null; }
7,717
public UndoableEdit insertString(int where, String str) throws BadLocationException { // check arguments int length = length(); int strLen = str.length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); // check if the gap is big enough to hold the string if ((gapEnd - gapStart) < strLen) // make room for this string and some more shiftEnd(strLen + DEFAULT_BUFSIZE); // are we at the gap boundary? if (where != gapStart) shiftGap(where); // now we can simple copy the string into the gap and adjust the // gap boundaries System.arraycopy(str.toCharArray(), 0, buffer, gapStart, strLen); gapStart += strLen; return null; }
public UndoableEdit insertString(int where, String str) throws BadLocationException { // check arguments int length = length(); int strLen = str.length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); // check if the gap is big enough to hold the string if ((gapEnd - gapStart) < strLen) // make room for this string and some more shiftEnd(strLen + DEFAULT_BUFSIZE); // are we at the gap boundary? if (where != gapStart) shiftGap(where); // now we can simple copy the string into the gap and adjust the // gap boundaries System.arraycopy(str.toCharArray(), 0, buffer, gapStart, strLen); gapStart += strLen; return null; }
7,718
public UndoableEdit remove(int where, int nitems) throws BadLocationException { // check arguments int length = length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); if ((where + nitems) > length) throw new BadLocationException("where + nitems cannot be greater" + " than the content length", where + nitems); // check if we are at the gap boundary if (where != gapStart) shiftGap(where); // now we simply have to enlarge the gap gapEnd += nitems; return null; }
public UndoableEdit remove(int where, int nitems) throws BadLocationException { // check arguments int length = length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); if ((where + nitems) > length) throw new BadLocationException("where + nitems cannot be greater" + " than the content length", where + nitems); // check if we are at the gap boundary if (where != gapStart) shiftGap(where); // now we simply have to enlarge the gap gapEnd += nitems; return null; }
7,719
public UndoableEdit remove(int where, int nitems) throws BadLocationException { // check arguments int length = length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); if ((where + nitems) > length) throw new BadLocationException("where + nitems cannot be greater" + " than the content length", where + nitems); // check if we are at the gap boundary if (where != gapStart) shiftGap(where); // now we simply have to enlarge the gap gapEnd += nitems; return null; }
public UndoableEdit remove(int where, int nitems) throws BadLocationException { // check arguments int length = length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); if ((where + nitems) > length) throw new BadLocationException("where + nitems cannot be greater" + " than the content length", where + nitems); // check if we are at the gap boundary if (where != gapStart) shiftGap(where); // now we simply have to enlarge the gap gapEnd += nitems; return null; }
7,720
protected void replace(int position, int rmSize, Object addItems, int addSize) { // Remove content shiftGap(position); gapEnd += rmSize; // If gap is too small, enlarge the gap. if ((gapEnd - gapStart) < addSize) shiftEnd(addSize); // Add new items to the buffer. System.arraycopy(addItems, 0, buffer, gapStart, addSize); gapStart += addSize; }
protected void replace(int position, int rmSize, Object addItems, int addSize) { // Remove content shiftGap(position); gapEnd += rmSize; // If gap is too small, enlarge the gap. if ((gapEnd - gapStart) < addSize) shiftEnd(addSize); // Add new items to the buffer. System.arraycopy(addItems, 0, buffer, gapStart, addSize); gapStart += addSize; }
7,721
protected void shiftGap(int newGapStart) { int newGapEnd = newGapStart + (gapEnd - gapStart); // Update the positions between newGapEnd and (old) gapEnd. The marks // must be shifted by (gapEnd - newGapEnd). int index1 = Collections.binarySearch(positions, new GapContentPosition( gapEnd)); int index2 = Collections.binarySearch(positions, new GapContentPosition( newGapEnd)); if (index1 > 0 && index2 > 0) { int i1 = Math.min(index1, index2); int i2 = Math.max(index1, index2); for (ListIterator i = positions.listIterator(i1); i.hasNext();) { if (i.nextIndex() > i2) break; GapContentPosition p = (GapContentPosition) i.next(); p.mark += gapEnd - newGapEnd; } if (newGapStart == gapStart) return; else if (newGapStart < gapStart) { System.arraycopy(buffer, newGapStart, buffer, newGapEnd, gapStart - newGapStart); gapStart = newGapStart; gapEnd = newGapEnd; } else { System.arraycopy(buffer, gapEnd, buffer, gapStart, newGapStart - gapStart); gapStart = newGapStart; gapEnd = newGapEnd; } } }
protected void shiftGap(int newGapStart) { int newGapEnd = newGapStart + (gapEnd - gapStart); // Update the positions between newGapEnd and (old) gapEnd. The marks // must be shifted by (gapEnd - newGapEnd). int index1 = Collections.binarySearch(positions, new GapContentPosition( gapEnd)); int index2 = Collections.binarySearch(positions, new GapContentPosition( newGapEnd)); if (index1 > 0 && index2 > 0) { int i1 = Math.min(index1, index2); int i2 = Math.max(index1, index2); for (ListIterator i = positions.listIterator(i1); i.hasNext();) { if (i.nextIndex() > i2) break; GapContentPosition p = (GapContentPosition) i.next(); p.mark += gapEnd - newGapEnd; } if (newGapStart == gapStart) return; else if (newGapStart < gapStart) { System.arraycopy(buffer, newGapStart, buffer, newGapEnd, gapStart - newGapStart); gapStart = newGapStart; gapEnd = newGapEnd; } else { System.arraycopy(buffer, gapEnd, buffer, gapStart, newGapStart - gapStart); gapStart = newGapStart; gapEnd = newGapEnd; } } }
7,723
protected void shiftGap(int newGapStart) { int newGapEnd = newGapStart + (gapEnd - gapStart); // Update the positions between newGapEnd and (old) gapEnd. The marks // must be shifted by (gapEnd - newGapEnd). int index1 = Collections.binarySearch(positions, new GapContentPosition( gapEnd)); int index2 = Collections.binarySearch(positions, new GapContentPosition( newGapEnd)); if (index1 > 0 && index2 > 0) { int i1 = Math.min(index1, index2); int i2 = Math.max(index1, index2); for (ListIterator i = positions.listIterator(i1); i.hasNext();) { if (i.nextIndex() > i2) break; GapContentPosition p = (GapContentPosition) i.next(); p.mark += gapEnd - newGapEnd; } if (newGapStart == gapStart) return; else if (newGapStart < gapStart) { System.arraycopy(buffer, newGapStart, buffer, newGapEnd, gapStart - newGapStart); gapStart = newGapStart; gapEnd = newGapEnd; } else { System.arraycopy(buffer, gapEnd, buffer, gapStart, newGapStart - gapStart); gapStart = newGapStart; gapEnd = newGapEnd; } } }
protected void shiftGap(int newGapStart) { int newGapEnd = newGapStart + (gapEnd - gapStart); // Update the positions between newGapEnd and (old) gapEnd. The marks // must be shifted by (gapEnd - newGapEnd). int index1 = Collections.binarySearch(positions, new GapContentPosition( gapEnd)); int index2 = Collections.binarySearch(positions, new GapContentPosition( newGapEnd)); if (index1 > 0 && index2 > 0) { int i1 = Math.min(index1, index2); int i2 = Math.max(index1, index2); for (ListIterator i = positions.listIterator(i1); i.hasNext();) { if (i.nextIndex() > i2) break; GapContentPosition p = (GapContentPosition) i.next(); p.mark += gapEnd - newGapEnd; if (newGapStart == gapStart) return; else if (newGapStart < gapStart) { System.arraycopy(buffer, newGapStart, buffer, newGapEnd, gapStart - newGapStart); gapStart = newGapStart; gapEnd = newGapEnd; else { System.arraycopy(buffer, gapEnd, buffer, gapStart, newGapStart - gapStart); gapStart = newGapStart; gapEnd = newGapEnd; }
7,724
public MidiFileFormat(int type, float divisionType, int resolution, int bytes, long microseconds) { this.type = type; this.divisionType = divisionType; this.resolution = resolution; this.bytes = bytes; this.microseconds = microseconds; }
public MidiFileFormat(int type, float divisionType, int resolution, int bytes, long microseconds) { this.type = type; this.divisionType = divisionType; this.resolution = resolution; this.bytes = bytes; this.microseconds = microseconds; }
7,725
public MidiFileFormat(int type, float divisionType, int resolution, int bytes, long microseconds) { this.type = type; this.divisionType = divisionType; this.resolution = resolution; this.bytes = bytes; this.microseconds = microseconds; }
public MidiFileFormat(int type, float divisionType, int resolution, int bytes, long microseconds) { this.type = type; this.divisionType = divisionType; this.resolution = resolution; this.bytes = bytes; this.microseconds = microseconds; }
7,726
public int getByteLength() { return bytes; }
public int getByteLength() { return byteLength; }
7,727
public long getMicrosecondLength() { return microseconds; }
public long getMicrosecondLength() { return microsecondLength; }
7,728
public void handleEvent(AWTEvent event) { Unsafe.debug("handleEvent(" + event + ")"); final int id = event.getID(); switch (id) { case PaintEvent.PAINT: case PaintEvent.UPDATE: { final Graphics g = getGraphics(); if (g != null) { //Point p = component.getLocationOnScreen(); //g.translate(p.x, p.y); if (id == PaintEvent.PAINT) { ((Component)component).paint(g); } else { ((Component)component).update(g); } //g.translate(-p.x, -p.y); g.dispose(); } } break; } }
public void handleEvent(AWTEvent event) { Unsafe.debug("handleEvent(" + event + ")"); final int id = event.getID(); switch (id) { case PaintEvent.PAINT: case PaintEvent.UPDATE: { final Graphics g = getGraphics(); if (g != null) { //Point p = component.getLocationOnScreen(); //g.translate(p.x, p.y); if (id == PaintEvent.PAINT) { ((Component)component).paint(g); } else { ((Component)component).update(g); } //g.translate(-p.x, -p.y); g.dispose(); } } break; } }
7,729
protected void formatDevice(Device device) throws IOException { /* Format the MBR & partitiontable */ GrubBootSector mbr = (GrubBootSector)(createFormatter().getBootSector()); mbr.getPartition(0).clear(); mbr.getPartition(1).clear(); mbr.getPartition(2).clear(); mbr.getPartition(3).clear(); IBMPartitionTableEntry pte = mbr.getPartition(0); pte.setBootIndicator(true); pte.setStartLba(1); pte.setNrSectors(geom.getTotalSectors() - 1); pte.setSystemIndicator(IBMPartitionTypes.PARTTYPE_DOS_FAT16_LT32M); pte.setStartCHS(geom.getCHS(pte.getStartLba())); pte.setEndCHS(geom.getCHS(pte.getStartLba() + pte.getNrSectors() - 1)); /*System.out.println("partition table:"); for (int i = 0; i < 4; i++) { System.out.println("" + i + " " + mbr.getPartition(i)); }*/ /* Format partition 0 */ part0 = new MappedBlockDeviceSupport(device, pte.getStartLba() * bytesPerSector, pte.getNrSectors() * bytesPerSector); GrubFatFormatter ff = (GrubFatFormatter)createFormatter(); ff.setInstallPartition(0x0000FFFF); ff.format(part0); GrubBootSector part0bs = (GrubBootSector)ff.getBootSector(); /* Fixup stage2 sector in MBR */ mbr.setStage2Sector(pte.getStartLba() + part0bs.getStage2Sector()); try { mbr.write((BlockDeviceAPI)device.getAPI(BlockDeviceAPI.class)); } catch (ApiNotFoundException ex) { throw new IOException("BlockDeviceAPI not found on device", ex); } //System.out.println("mbr stage2 sector=" + mbr.getStage2Sector()); }
protected void formatDevice(Device device) throws IOException { /* Format the MBR & partitiontable */ GrubBootSector mbr = (GrubBootSector)(createFormatter().getBootSector()); mbr.getPartition(0).clear(); mbr.getPartition(1).clear(); mbr.getPartition(2).clear(); mbr.getPartition(3).clear(); IBMPartitionTableEntry pte = mbr.getPartition(0); pte.setBootIndicator(true); pte.setStartLba(1); pte.setNrSectors(geom.getTotalSectors() - 1); pte.setSystemIndicator(IBMPartitionTypes.PARTTYPE_DOS_FAT16_LT32M); pte.setStartCHS(geom.getCHS(pte.getStartLba())); pte.setEndCHS(geom.getCHS(pte.getStartLba() + pte.getNrSectors() - 1)); /*System.out.println("partition table:"); for (int i = 0; i < 4; i++) { System.out.println("" + i + " " + mbr.getPartition(i)); }*/ /* Format partition 0 */ part0 = new MappedBlockDeviceSupport(device, pte.getStartLba() * bytesPerSector, pte.getNrSectors() * bytesPerSector); GrubFatFormatter ff = (GrubFatFormatter)createFormatter(); ff.setInstallPartition(0x0000FFFF); ff.format(part0); GrubBootSector part0bs = (GrubBootSector)ff.getBootSector(); /* Fixup stage2 sector in MBR */ mbr.setStage2Sector(pte.getStartLba() + part0bs.getStage2Sector()); try { mbr.write((BlockDeviceAPI)device.getAPI(BlockDeviceAPI.class)); } catch (ApiNotFoundException ex) { throw new IOException("BlockDeviceAPI not found on device", ex); } //System.out.println("mbr stage2 sector=" + mbr.getStage2Sector()); }
7,730
public void drawText(Graphics2D g, String text, Font font, int x, int y) { FontProvider prv = getProvider(font); Font l_font = font; if (prv == null) { l_font = new Font("Luxi Sans", Font.PLAIN, 10); //log.error("No FontProvider for font=" + font + " using " + l_font + " instead."); prv = getProvider(l_font); } final TextRenderer renderer = prv.getTextRenderer(l_font); renderer.render(g, text, x, y); }
public void drawText(Graphics2D g, String text, Font font, int x, int y) { FontProvider prv = getProvider(font); Font txFont = font; if (prv == null) { l_font = new Font("Luxi Sans", Font.PLAIN, 10); //log.error("No FontProvider for font=" + font + " using " + l_font + " instead."); prv = getProvider(l_font); } final TextRenderer renderer = prv.getTextRenderer(l_font); renderer.render(g, text, x, y); }
7,731
public void drawText(Graphics2D g, String text, Font font, int x, int y) { FontProvider prv = getProvider(font); Font l_font = font; if (prv == null) { l_font = new Font("Luxi Sans", Font.PLAIN, 10); //log.error("No FontProvider for font=" + font + " using " + l_font + " instead."); prv = getProvider(l_font); } final TextRenderer renderer = prv.getTextRenderer(l_font); renderer.render(g, text, x, y); }
public void drawText(Graphics2D g, String text, Font font, int x, int y) { FontProvider prv = getProvider(font); Font l_font = font; if (prv == null) { l_font = new Font("Luxi Sans", Font.PLAIN, 10); //log.error("No FontProvider for font=" + font + " using " + l_font + " instead."); prv = getProvider(l_font); } final TextRenderer renderer = prv.getTextRenderer(l_font); renderer.render(g, text, x, y); }
7,732
public void drawText(Graphics2D g, String text, Font font, int x, int y) { FontProvider prv = getProvider(font); Font l_font = font; if (prv == null) { l_font = new Font("Luxi Sans", Font.PLAIN, 10); //log.error("No FontProvider for font=" + font + " using " + l_font + " instead."); prv = getProvider(l_font); } final TextRenderer renderer = prv.getTextRenderer(l_font); renderer.render(g, text, x, y); }
public void drawText(Graphics2D g, String text, Font font, int x, int y) { FontProvider prv = getProvider(font); Font l_font = font; if (prv == null) { l_font = new Font("Luxi Sans", Font.PLAIN, 10); //log.error("No FontProvider for font=" + font + " using " + l_font + " instead."); prv = getProvider(l_font); } final TextRenderer renderer = prv.getTextRenderer(l_font); renderer.render(g, text, x, y); }
7,733
public FontMetrics getFontMetrics(Font font) { final FontProvider prv = getProvider(font); if (prv != null) { return prv.getFontMetrics(font); } else { return new EmptyFontMetrics(font); } }
public FontMetrics getFontMetrics(Font font) { FontProvider prv = getProvider(font); Font txFont = font; if (prv == null) { txFont = getTranslatedFont(font); prv = getProvider(txFont); } if (prv != null) { return prv.getFontMetrics(font); } else { return new EmptyFontMetrics(font); } }
7,734
public FontMetrics getFontMetrics(Font font) { final FontProvider prv = getProvider(font); if (prv != null) { return prv.getFontMetrics(font); } else { return new EmptyFontMetrics(font); } }
public FontMetrics getFontMetrics(Font font) { final FontProvider prv = getProvider(font); if (prv != null) { return prv.getFontMetrics(txFont); } else { return new EmptyFontMetrics(font); } }
7,735
public FontMetrics getFontMetrics(Font font) { final FontProvider prv = getProvider(font); if (prv != null) { return prv.getFontMetrics(font); } else { return new EmptyFontMetrics(font); } }
public FontMetrics getFontMetrics(Font font) { final FontProvider prv = getProvider(font); if (prv != null) { return prv.getFontMetrics(font); } else { log.error("No provider found for font " + txFont); return new EmptyFontMetrics(txFont); } }
7,736
public static int getHashCode(Object obj) { if (obj == null) { throw new NullPointerException(); } else { return ObjectReference.fromObject(obj).toAddress().toInt(); } }
public static int getHashCode(Object obj) { if (obj == null) { return 0; } else { return ObjectReference.fromObject(obj).toAddress().toInt(); } }
7,739
public DynAny create_dyn_any(Any _0) throws InconsistentTypeCode { throw new MARSHAL(NOT_APPLICABLE); }
public DynAny create_dyn_any(Any _0) throws InconsistentTypeCode { MARSHAL m = new MARSHAL(NOT_APPLICABLE); m.minor = Minor.Inappropriate; throw m; }
7,740
public DynAny create_dyn_any_from_type_code(TypeCode _0) throws InconsistentTypeCode { throw new MARSHAL(NOT_APPLICABLE); }
public DynAny create_dyn_any_from_type_code(TypeCode _0) throws InconsistentTypeCode { MARSHAL m = new MARSHAL(NOT_APPLICABLE); m.minor = Minor.Inappropriate; throw m; }
7,741
private void jbInit() throws Exception { this.setSize(new Dimension(400,300)); Properties sesProps = new Properties(); // Start loading properties - Host must exist sesProps.put(SESSION_HOST,getParameter("host")); if (isSpecified("-e")) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p")) { sesProps.put(SESSION_HOST_PORT,getParameter("-p")); }// if (isSpecified("-f",args))// propFileName = getParm("-f",args); if (isSpecified("-cp")) sesProps.put(SESSION_CODE_PAGE ,getParameter("-cp")); if (isSpecified("-gui")) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132")) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // socks proxy host argument if (isSpecified("-sph")) { sesProps.put(SESSION_PROXY_HOST ,getParameter("-sph")); } // socks proxy port argument if (isSpecified("-spp")) sesProps.put(SESSION_PROXY_PORT ,getParameter("-spp")); // check if device name is specified if (isSpecified("-dn")) sesProps.put(SESSION_DEVICE_NAME ,getParameter("-dn")); if (isSpecified("-L")) LangTool.init(parseLocale(getParameter("-L"))); else LangTool.init(); manager = new SessionManager(); Session s = manager.openSession(sesProps,"","Test Applet"); this.getContentPane().add(s); s.grabFocus(); s.connect(); }
private void jbInit() throws Exception { this.setSize(new Dimension(400,300)); Properties sesProps = new Properties(); // Start loading properties - Host must exist sesProps.put(SESSION_HOST,getParameter("host")); if (isSpecified("-e")) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p")) { sesProps.put(SESSION_HOST_PORT,getParameter("-p")); }// if (isSpecified("-f",args))// propFileName = getParm("-f",args); if (isSpecified("-cp")) sesProps.put(SESSION_CODE_PAGE ,getParameter("-cp")); if (isSpecified("-gui")) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132")) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // socks proxy host argument if (isSpecified("-sph")) { sesProps.put(SESSION_PROXY_HOST ,getParameter("-sph")); } // socks proxy port argument if (isSpecified("-spp")) sesProps.put(SESSION_PROXY_PORT ,getParameter("-spp")); // check if device name is specified if (isSpecified("-dn")) sesProps.put(SESSION_DEVICE_NAME ,getParameter("-dn")); if (isSpecified("-L")) LangTool.init(parseLocale(getParameter("-L"))); else LangTool.init(); manager = new SessionManager(); Session s = manager.openSession(sesProps,"","Test Applet"); this.getContentPane().add(s); s.connect(); }
7,742
protected Keymap createKeymap() { String prefix = getPropertyPrefix(); JTextComponent.KeyBinding[] bindings = (JTextComponent.KeyBinding[]) UIManager.get(prefix + ".keyBindings"); if (bindings == null) { bindings = new JTextComponent.KeyBinding[0]; // FIXME: Putting something into the defaults map is certainly wrong. // Must be fixed somehow. UIManager.put(prefix + ".keyBindings", bindings); } Keymap km = JTextComponent.addKeymap(getKeymapName(), JTextComponent.getKeymap(JTextComponent.DEFAULT_KEYMAP)); JTextComponent.loadKeymap(km, bindings, textComponent.getActions()); return km; }
protected Keymap createKeymap() { String prefix = getPropertyPrefix(); JTextComponent.KeyBinding[] bindings = (JTextComponent.KeyBinding[]) UIManager.get(prefix + ".keyBindings"); if (bindings == null) { bindings = new JTextComponent.KeyBinding[0]; // FIXME: Putting something into the defaults map is certainly wrong. // Must be fixed somehow. UIManager.put(prefix + ".keyBindings", bindings); } Keymap km = JTextComponent.addKeymap(getKeymapName(), JTextComponent.getKeymap(JTextComponent.DEFAULT_KEYMAP)); JTextComponent.loadKeymap(km, bindings, textComponent.getActions()); return km; }
7,743
protected Keymap createKeymap() { String prefix = getPropertyPrefix(); JTextComponent.KeyBinding[] bindings = (JTextComponent.KeyBinding[]) UIManager.get(prefix + ".keyBindings"); if (bindings == null) { bindings = new JTextComponent.KeyBinding[0]; // FIXME: Putting something into the defaults map is certainly wrong. // Must be fixed somehow. UIManager.put(prefix + ".keyBindings", bindings); } Keymap km = JTextComponent.addKeymap(getKeymapName(), JTextComponent.getKeymap(JTextComponent.DEFAULT_KEYMAP)); JTextComponent.loadKeymap(km, bindings, textComponent.getActions()); return km; }
protected Keymap createKeymap() { String prefix = getPropertyPrefix(); JTextComponent.KeyBinding[] bindings = (JTextComponent.KeyBinding[]) UIManager.get(prefix + ".keyBindings"); if (bindings == null) { bindings = new JTextComponent.KeyBinding[0]; // FIXME: Putting something into the defaults map is certainly wrong. // Must be fixed somehow. UIManager.put(prefix + ".focusInputMap", bindings); } Keymap km = JTextComponent.addKeymap(getKeymapName(), JTextComponent.getKeymap(JTextComponent.DEFAULT_KEYMAP)); JTextComponent.loadKeymap(km, bindings, textComponent.getActions()); return km; }
7,744
protected void installKeyboardActions() { // load any bindings for the older Keymap interface Keymap km = JTextComponent.getKeymap(getKeymapName()); if (km == null) km = createKeymap(); textComponent.setKeymap(km); // load any bindings for the newer InputMap / ActionMap interface SwingUtilities.replaceUIInputMap(textComponent, JComponent.WHEN_FOCUSED, getInputMap(JComponent.WHEN_FOCUSED)); SwingUtilities.replaceUIActionMap(textComponent, getActionMap()); }
protected void installKeyboardActions() { // load any bindings for the older Keymap interface Keymap km = JTextComponent.getKeymap(getKeymapName()); if (km == null) km = createKeymap(); textComponent.setKeymap(km); // load any bindings for the newer InputMap / ActionMap interface SwingUtilities.replaceUIInputMap(textComponent, JComponent.WHEN_FOCUSED, getInputMap(JComponent.WHEN_FOCUSED)); SwingUtilities.replaceUIActionMap(textComponent, getActionMap()); }
7,745
protected void installKeyboardActions() { // load any bindings for the older Keymap interface Keymap km = JTextComponent.getKeymap(getKeymapName()); if (km == null) km = createKeymap(); textComponent.setKeymap(km); // load any bindings for the newer InputMap / ActionMap interface SwingUtilities.replaceUIInputMap(textComponent, JComponent.WHEN_FOCUSED, getInputMap(JComponent.WHEN_FOCUSED)); SwingUtilities.replaceUIActionMap(textComponent, getActionMap()); }
protected void installKeyboardActions() { // load any bindings for the older Keymap interface Keymap km = JTextComponent.getKeymap(getKeymapName()); if (km == null) km = createKeymap(); textComponent.setKeymap(km); // load any bindings for the newer InputMap / ActionMap interface SwingUtilities.replaceUIInputMap(textComponent, JComponent.WHEN_FOCUSED, getInputMap(JComponent.WHEN_FOCUSED)); SwingUtilities.replaceUIActionMap(textComponent, getActionMap()); }
7,746
protected void installKeyboardActions() { // load any bindings for the older Keymap interface Keymap km = JTextComponent.getKeymap(getKeymapName()); if (km == null) km = createKeymap(); textComponent.setKeymap(km); // load any bindings for the newer InputMap / ActionMap interface SwingUtilities.replaceUIInputMap(textComponent, JComponent.WHEN_FOCUSED, getInputMap(JComponent.WHEN_FOCUSED)); SwingUtilities.replaceUIActionMap(textComponent, getActionMap()); }
protected void installKeyboardActions() { // load any bindings for the older Keymap interface Keymap km = JTextComponent.getKeymap(getKeymapName()); if (km == null) km = createKeymap(); textComponent.setKeymap(km); // load any bindings for the newer InputMap / ActionMap interface SwingUtilities.replaceUIInputMap(textComponent, JComponent.WHEN_FOCUSED, getInputMap(JComponent.WHEN_FOCUSED)); SwingUtilities.replaceUIActionMap(textComponent, createActionMap()); ActionMap parentActionMap = new ActionMapUIResource(); Action[] actions = textComponent.getActions(); for (int j = 0; j < actions.length; j++) { Action currAction = actions[j]; parentActionMap.put(currAction.getValue(Action.NAME), currAction); } SwingUtilities.replaceUIActionMap(textComponent, parentActionMap); }
7,747
public void setDisplayedMnemonicIndex(int newIndex) throws IllegalArgumentException { if (newIndex < -1 || (text != null && newIndex >= text.length())) throw new IllegalArgumentException(); if (newIndex == -1 || text == null || text.charAt(newIndex) != displayedMnemonic) newIndex = -1; if (newIndex != displayedMnemonicIndex) { int oldIndex = displayedMnemonicIndex; displayedMnemonicIndex = newIndex; firePropertyChange("displayedMnemonicIndex", oldIndex, newIndex); } }
public void setDisplayedMnemonicIndex(int newIndex) throws IllegalArgumentException { if (newIndex < -1 || (text != null && newIndex >= text.length())) throw new IllegalArgumentException(); if (newIndex == -1 || text == null || text.charAt(newIndex) != displayedMnemonic) newIndex = -1; if (newIndex != displayedMnemonicIndex) { int oldIndex = displayedMnemonicIndex; displayedMnemonicIndex = newIndex; firePropertyChange("displayedMnemonicIndex", oldIndex, newIndex); } }
7,748
public void setDisplayedMnemonicIndex(int newIndex) throws IllegalArgumentException { if (newIndex < -1 || (text != null && newIndex >= text.length())) throw new IllegalArgumentException(); if (newIndex == -1 || text == null || text.charAt(newIndex) != displayedMnemonic) newIndex = -1; if (newIndex != displayedMnemonicIndex) { int oldIndex = displayedMnemonicIndex; displayedMnemonicIndex = newIndex; firePropertyChange("displayedMnemonicIndex", oldIndex, newIndex); } }
public void setDisplayedMnemonicIndex(int newIndex) throws IllegalArgumentException { if (newIndex < -1 || (text != null && newIndex >= text.length())) throw new IllegalArgumentException(); if (newIndex == -1 || text == null || text.charAt(newIndex) != displayedMnemonic) newIndex = -1; if (newIndex != displayedMnemonicIndex) { int oldIndex = displayedMnemonicIndex; displayedMnemonicIndex = newIndex; firePropertyChange("displayedMnemonicIndex", oldIndex, newIndex); } }
7,749