rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
g2.setColor(color.topColor);
g2.setColor(bcolor.topColor());
private static void paintSolid(final Graphics2D g2, final Rectangle bounds, final Border border, final BorderColor color, final int sides, int currentSide) { //Bug in polygon painting paints an extra pixel to the right and bottom //But clipping works fine! Polygon poly = getBevelledPolygon(boun...
if (border.top == 1) {
if ((int)border.top() == 1) {
private static void paintSolid(final Graphics2D g2, final Rectangle bounds, final Border border, final BorderColor color, final int sides, int currentSide) { //Bug in polygon painting paints an extra pixel to the right and bottom //But clipping works fine! Polygon poly = getBevelledPolygon(boun...
g2.setColor(color.bottomColor); if (border.bottom == 1) {
g2.setColor(bcolor.bottomColor()); if ((int)border.bottom() == 1) {
private static void paintSolid(final Graphics2D g2, final Rectangle bounds, final Border border, final BorderColor color, final int sides, int currentSide) { //Bug in polygon painting paints an extra pixel to the right and bottom //But clipping works fine! Polygon poly = getBevelledPolygon(boun...
g2.setColor(color.rightColor); if (border.right == 1) {
g2.setColor(bcolor.rightColor()); if ((int)border.right() == 1) {
private static void paintSolid(final Graphics2D g2, final Rectangle bounds, final Border border, final BorderColor color, final int sides, int currentSide) { //Bug in polygon painting paints an extra pixel to the right and bottom //But clipping works fine! Polygon poly = getBevelledPolygon(boun...
g2.setColor(color.leftColor); if (border.left == 1) {
g2.setColor(bcolor.leftColor()); if ((int)border.left() == 1) {
private static void paintSolid(final Graphics2D g2, final Rectangle bounds, final Border border, final BorderColor color, final int sides, int currentSide) { //Bug in polygon painting paints an extra pixel to the right and bottom //But clipping works fine! Polygon poly = getBevelledPolygon(boun...
public static Rectangle shrinkRect(final Rectangle rect, final Border border, int sides) {
public static Rectangle shrinkRect(final Rectangle rect, final BorderPropertySet border, int sides) {
public static Rectangle shrinkRect(final Rectangle rect, final Border border, int sides) { Rectangle r2 = new Rectangle(); r2.x = rect.x + ((sides & LEFT) == 0 ? 0 : border.left); r2.width = rect.width - ((sides & LEFT) == 0 ? 0 : border.left) - ((sides & RIGHT) == 0 ? 0 : border.right); ...
r2.x = rect.x + ((sides & LEFT) == 0 ? 0 : border.left); r2.width = rect.width - ((sides & LEFT) == 0 ? 0 : border.left) - ((sides & RIGHT) == 0 ? 0 : border.right); r2.y = rect.y + ((sides & TOP) == 0 ? 0 : border.top); r2.height = rect.height - ((sides & TOP) == 0 ? 0 : border.top) - ((sides & BOTTOM) == 0 ? 0 : bord...
r2.x = rect.x + ((sides & LEFT) == 0 ? 0 : (int)border.left()); r2.width = rect.width - ((sides & LEFT) == 0 ? 0 : (int)border.left()) - ((sides & RIGHT) == 0 ? 0 : (int)border.right()); r2.y = rect.y + ((sides & TOP) == 0 ? 0 : (int)border.top()); r2.height = rect.height - ((sides & TOP) == 0 ? 0 : (int)border.top()) ...
public static Rectangle shrinkRect(final Rectangle rect, final Border border, int sides) { Rectangle r2 = new Rectangle(); r2.x = rect.x + ((sides & LEFT) == 0 ? 0 : border.left); r2.width = rect.width - ((sides & LEFT) == 0 ? 0 : border.left) - ((sides & RIGHT) == 0 ? 0 : border.right); ...
SimplePrincipal principal = new SimplePrincipal(user); char[] passwordChars = null; if (password != null) passwordChars = password.toCharArray(); Subject subject = new Subject();
return new Subject();
public Subject authenticate(String user, String password) throws JMSSecurityException { boolean trace = log.isTraceEnabled(); if (trace) { log.trace("Authenticating, username=" + user); } SimplePrincipal principal = new SimplePrincipal(user); char[] passwordChars =...
if (authMgr.isValid(principal, passwordChars, subject)) { SecurityActions.pushSubjectContext(principal, passwordChars, subject); if (trace) log.trace("Username: " + user + " is authenticated"); return subject; } else { if (trace) log.trace("User: " + user + " is NOT authenticated"); throw new JMSSecurityException("User...
public Subject authenticate(String user, String password) throws JMSSecurityException { boolean trace = log.isTraceEnabled(); if (trace) { log.trace("Authenticating, username=" + user); } SimplePrincipal principal = new SimplePrincipal(user); char[] passwordChars =...
Principal principal = user == null ? null : new SimplePrincipal(user); boolean hasRole = realmMapping.doesUserHaveRole(principal, rolePrincipals); if (log.isTraceEnabled()) { log.trace("User is authorized? " + hasRole); } return hasRole;
return true;
public boolean authorize(String user, Set rolePrincipals) { if (log.isTraceEnabled()) log.trace( "Checking authorize on user: " + user + " for rolePrincipals " + rolePrincipals.toString()); Principal principal = user == null ? null ...
ClientStubBase csb = (ClientStubBase)conn;
ConnectionStub csb = (ConnectionStub)conn;
public Object handleCreateConnectionDelegate(Invocation invocation) throws Throwable { ConnectionDelegate conn = (ConnectionDelegate)invocation.invokeNext(); ClientStubBase csb = (ClientStubBase)conn; csb.init(); csb.setState(new ConnectionState(conn)); ...
csb.setState(new ConnectionState(conn));
csb.setState(new ConnectionState(conn, csb.getServerId()));
public Object handleCreateConnectionDelegate(Invocation invocation) throws Throwable { ConnectionDelegate conn = (ConnectionDelegate)invocation.invokeNext(); ClientStubBase csb = (ClientStubBase)conn; csb.init(); csb.setState(new ConnectionState(conn)); ...
long id = this.insertMappingRow(TYPE_DURABLE_SUB, topicName, subscriptionName, clientID, selector, new Boolean(noLocal));
long id = this.getNextId(); insertMappingRow(id, TYPE_DURABLE_SUB, topicName, subscriptionName, clientID, selector, new Boolean(noLocal));
public CoreDurableSubscription createDurableSubscription(String topicName, String clientID, String subscriptionName, String selector, ...
long id = getNextId();
long id = this.getNextId();
public CoreSubscription createSubscription(String topicName, String selector, boolean noLocal, MessageStore ms, PersistenceManager pm) throws JMSException { try { //First insert a row in the db long id = getNextId(); Topic topic = (Topic)getCoreDestinationInternal...
id = insertMappingRow(isQueue ? TYPE_QUEUE : TYPE_TOPIC, destName, null, null, null, null);
id = this.getNextId(); insertMappingRow(id, isQueue ? TYPE_QUEUE : TYPE_TOPIC, destName, null, null, null, null);
public void deployCoreDestination(boolean isQueue, String destName, MessageStore ms, PersistenceManager pm, int fullSize, int pageSize...
protected synchronized long getNextId()
protected long getNextId() throws Exception
protected synchronized long getNextId() { //TODO Use IdManager return idCounter++; }
return idCounter++;
long id = this.channelIDManager.getId(); return id;
protected synchronized long getNextId() { //TODO Use IdManager return idCounter++; }
selectId = sqlProperties.getProperty("SELECT_ID", selectId);
protected void initSqlProperties() { createUserTable = sqlProperties.getProperty("CREATE_USER_TABLE", createUserTable); createRoleTable = sqlProperties.getProperty("CREATE_ROLE_TABLE", createRoleTable); selectPreConfClientId = sqlProperties.getProperty("SELECT_PRECONF_CLIENTID", selectPreConfClientI...
protected long insertMappingRow(char type, String jmsDestName, String jmsSubName, String clientID,
protected void insertMappingRow(long id, char type, String jmsDestName, String jmsSubName, String clientID,
protected long insertMappingRow(char type, String jmsDestName, String jmsSubName, String clientID, String selector, Boolean noLocal) throws Exception { Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; TransactionWrapper wrap = new Tran...
ps.setNull(1, Types.BIGINT);
ps.setLong(1, id);
protected long insertMappingRow(char type, String jmsDestName, String jmsSubName, String clientID, String selector, Boolean noLocal) throws Exception { Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; TransactionWrapper wrap = new Tran...
ps = null; ps = conn.prepareStatement(selectId); rs = ps.executeQuery(); rs.next(); long id = rs.getLong(1); failed = false; return id;
ps = null;
protected long insertMappingRow(char type, String jmsDestName, String jmsSubName, String clientID, String selector, Boolean noLocal) throws Exception { Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; TransactionWrapper wrap = new Tran...
pm.addReferences(channel1.getChannelID(), refs, false);
pm.pageReferences(channel1.getChannelID(), refs, false);
protected void addRemoveGetReferences(boolean batch) throws Throwable { doSetup(false, 100); Channel channel1 = new SimpleChannel(0, ms); Channel channel2 = new SimpleChannel(1, ms); Message[] m = createMessages(10); MessageReference ref1 = ms.reference(m[0]); ...
pm.addReferences(channel2.getChannelID(), refs, false);
pm.pageReferences(channel2.getChannelID(), refs, false);
protected void addRemoveGetReferences(boolean batch) throws Throwable { doSetup(false, 100); Channel channel1 = new SimpleChannel(0, ms); Channel channel2 = new SimpleChannel(1, ms); Message[] m = createMessages(10); MessageReference ref1 = ms.reference(m[0]); ...
pm.removeReferences(channel2.getChannelID(), refs);
pm.removeDepagedReferences(channel2.getChannelID(), refs);
protected void addRemoveGetReferences(boolean batch) throws Throwable { doSetup(false, 100); Channel channel1 = new SimpleChannel(0, ms); Channel channel2 = new SimpleChannel(1, ms); Message[] m = createMessages(10); MessageReference ref1 = ms.reference(m[0]); ...
pm.removeReferences(channel1.getChannelID(), refs);
pm.removeDepagedReferences(channel1.getChannelID(), refs);
protected void addRemoveGetReferences(boolean batch) throws Throwable { doSetup(false, 100); Channel channel1 = new SimpleChannel(0, ms); Channel channel2 = new SimpleChannel(1, ms); Message[] m = createMessages(10); MessageReference ref1 = ms.reference(m[0]); ...
pm.addReferences(channel.getChannelID(), refs, false);
pm.pageReferences(channel.getChannelID(), refs, false);
public void testGetInitialRefInfos() throws Throwable { doSetup(false, 100); Channel channel = new SimpleChannel(0, ms); Message[] m = createMessages(10); List refs = new ArrayList(); MessageReference ref1 = ms.reference(m[0]); MessageReference ref2 = ms.refere...
pm.addReferences(channel.getChannelID(), refs, false);
pm.pageReferences(channel.getChannelID(), refs, false);
public void testPageOrders() throws Throwable { doSetup(false, 100); Channel channel = new SimpleChannel(0, ms); Message[] m = createMessages(10); List refs = new ArrayList(); MessageReference ref1 = ms.reference(m[0]); MessageReference ref2 = ms.reference(m[1]...
panel.setDocument(new File("demos/photogallery/xhtml/gallery.xhtml").toURL());
panel.setDocument(new File("demos/photogallery/xhtml/gallery.xhtml").toURL().toExternalForm());
public static void main(String[] args) throws Exception { Toolkit.getDefaultToolkit().setDynamicLayout(true); XHTMLPanel panel = new XHTMLPanel(); Dimension size = new Dimension(200,200); panel.setPreferredSize(size); panel.setDocument(new File("demos/photogallery/...
return "JPanel";
return super.paramString();
protected String paramString() { return "JPanel"; }
getGraphics().translate(x, y); if (bfc != null) {
if (bfc != null) {
public void translate(int x, int y) { //Uu.p("trans: " + x + "," + y); getGraphics().translate(x, y);//TODO: is this healthy and thread-safe enough? if (bfc != null) { bfc.translate(x, y); } xoff += x; yoff += y; }
public int capacity() { return elements.size(); }
public int capacity() { return elements.capacity(); }
public int capacity() { return elements.size(); } // capacity()
public void copyInto(Object[] array) { int index; int size; Object[] srcArray; size = size(); srcArray = toArray(); for (index = 0; index < size; index++) { array[index] = srcArray[index]; } }
public void copyInto(Object[] array) { elements.copyInto(array); }
public void copyInto(Object[] array) { // Variables int index; int size; Object[] srcArray; // Initialize size = size(); srcArray = toArray(); // Process Elements for (index = 0; index < size; index++) { array[index] = srcArray[index]; } // for } // copyInto()
public Object elementAt(int index) { return elements.get(index); }
public Object elementAt(int index) { return elements.elementAt(index); }
public Object elementAt(int index) { return elements.get(index); } // elementAt()
public Enumeration elements() { Vector vector; vector = new Vector(elements); return vector.elements(); }
public Enumeration elements() { return elements.elements(); }
public Enumeration elements() { // TODO // Note: This is a pathetic implementation. If Vector // was used for storage, this wouldn't be an issue. I'll // have to implement an Enumeration inner class sometime. // Variables Vector vector; // Get Enumeration vector = new Vector(elements); return vector.element...
public Object firstElement() { Object element; try { element = elements.get(0); return element; } catch (IndexOutOfBoundsException e) { throw new NoSuchElementException(); } }
public Object firstElement() { return elements.firstElement(); }
public Object firstElement() { // Variables Object element; try { element = elements.get(0); return element; } catch (IndexOutOfBoundsException e) { throw new NoSuchElementException(); } // try } // firstElement()
public void insertElementAt(Object element, int index) { elements.add(index, element); fireIntervalRemoved(this, index, index); }
public void insertElementAt(Object element, int index) { elements.insertElementAt(element, index); fireIntervalAdded(this, index, index); }
public void insertElementAt(Object element, int index) { // Process Action elements.add(index, element); // Send event fireIntervalRemoved(this, index, index); } // insertElementAt()
public Object lastElement() { Object element; try { element = elements.get(elements.size() - 1); return element; } catch (ArrayIndexOutOfBoundsException e) { throw new NoSuchElementException(); } }
public Object lastElement() { return elements.lastElement(); }
public Object lastElement() { // Variables Object element; try { element = elements.get(elements.size() - 1); return element; } catch (ArrayIndexOutOfBoundsException e) { throw new NoSuchElementException(); } // try } // lastElement()
public void removeRange(int startIndex, int endIndex) { int index; if (startIndex > endIndex) { throw new IllegalArgumentException(); } for (index = endIndex; index >= startIndex; index--) { elements.remove(index); } fireIntervalRemoved(this, startIndex, endIndex); }
public void removeRange(int startIndex, int endIndex) { int index; if (startIndex > endIndex) throw new IllegalArgumentException(); for (index = endIndex; index >= startIndex; index--) elements.remove(index); fireIntervalRemoved(this, startIndex, endIndex); }
public void removeRange(int startIndex, int endIndex) { // Variables int index; // Check Indices if (startIndex > endIndex) { throw new IllegalArgumentException(); } // if // Process Elements for (index = endIndex; index >= startIndex; index--) { elements.remove(index); } // for // Send event fireInterv...
public void setElementAt(Object element, int index) { elements.set(index, element); fireContentsChanged(this, index, index); }
public void setElementAt(Object element, int index) { elements.setElementAt(element, index); fireContentsChanged(this, index, index); }
public void setElementAt(Object element, int index) { // Process Action elements.set(index, element); // Send event fireContentsChanged(this, index, index); } // setElementAt()
public void setSize(int size) { elements.ensureCapacity(size); }
public void setSize(int size) { elements.setSize(size); }
public void setSize(int size) { elements.ensureCapacity(size); } // setSize()
public Name parse (String name) throws NamingException;
Name parse (String name) throws NamingException;
public Name parse (String name) throws NamingException;
panel.setInteractive(false);
public Graphics2DRenderer() { panel = new XHTMLPanel(); panel.setThreadedLayout(false); }
public Class getCategory()
public final Class getCategory()
public Class getCategory() { return Compression.class; }
public String getName()
public final String getName()
public String getName() { return "compression"; }
public void addAsfMessage(Message m, String receiverID)
public void addAsfMessage(Message m, String receiverID, ConsumerDelegate cons)
public void addAsfMessage(Message m, String receiverID) { log.warn("addAsfMessage should not be handled at the server endpoint"); }
PersistenceManager pm = connectionEndpoint.getServerPeer().getPersistenceManager();
public ConsumerDelegate createConsumerDelegate(Destination jmsDestination, String selector, boolean noLocal, String subscriptionName, ...
ClientManager clientManager = serverPeer.getClientManager();
StateManager stateManager = serverPeer.getStateManager();
public ConsumerDelegate createConsumerDelegate(Destination jmsDestination, String selector, boolean noLocal, String subscriptionName, ...
subscription = clientManager.getDurableSubscription(clientID, subscriptionName);
subscription = stateManager.getDurableSubscription(clientID, subscriptionName);
public ConsumerDelegate createConsumerDelegate(Destination jmsDestination, String selector, boolean noLocal, String subscriptionName, ...
DurableSubscription removed = this.serverPeer.getClientManager().
boolean removed = this.serverPeer.getStateManager().
public ConsumerDelegate createConsumerDelegate(Destination jmsDestination, String selector, boolean noLocal, String subscriptionName, ...
if (removed == null)
if (!removed)
public ConsumerDelegate createConsumerDelegate(Destination jmsDestination, String selector, boolean noLocal, String subscriptionName, ...
subscription = new DurableSubscription(subscriptionName, topic, selector, ms, pm); clientManager.addDurableSubscription(clientID, subscriptionName, (DurableSubscription)subscription);
subscription = stateManager.createDurableSubscription(d.getName(), clientID, subscriptionName, selector);
public ConsumerDelegate createConsumerDelegate(Destination jmsDestination, String selector, boolean noLocal, String subscriptionName, ...
DurableSubscription subscription = this.serverPeer.getClientManager(). removeDurableSubscription(this.connectionEndpoint.clientID, subscriptionName);
DurableSubscription subscription = this.serverPeer.getStateManager().getDurableSubscription(this.connectionEndpoint.clientID, subscriptionName);
public void unsubscribe(String subscriptionName) throws JMSException { if (closed) { throw new IllegalStateException("Session is closed"); } if (subscriptionName == null) { throw new InvalidDestinationException("Destination is null"); } DurableSubscription subscri...
boolean removed = this.serverPeer.getStateManager().removeDurableSubscription(this.connectionEndpoint.clientID, subscriptionName); if (!removed) { throw new JMSException("Failed to remove durable subscription"); }
public void unsubscribe(String subscriptionName) throws JMSException { if (closed) { throw new IllegalStateException("Session is closed"); } if (subscriptionName == null) { throw new InvalidDestinationException("Destination is null"); } DurableSubscription subscri...
return null;
return AccessibleRole.SCROLL_BAR;
public AccessibleRole getAccessibleRole() { return null; }
return null;
AccessibleStateSet result = super.getAccessibleStateSet(); if (orientation == JScrollBar.HORIZONTAL) result.add(AccessibleState.HORIZONTAL); else if (orientation == JScrollBar.VERTICAL) result.add(AccessibleState.VERTICAL); return result;
public AccessibleStateSet getAccessibleStateSet() { return null; }
return null;
return new Integer(getMaximum() - model.getExtent());
public Number getMaximumAccessibleValue() { return null; }
int count = 0;
protected void chartVariableBenchmark(String bmName, String variableName, String xLabel, String yLabel, String title, String imageFileName) throws Exception { log.info("Charting benchmark:" + bmName); Benchmark bm = pm.getBenchmark(bmName); if (bm == null) { return; } ...
chartSimpleBenchmark("Queue17", "Date", "Browse rate (messages/sec)", "Browse persistent messages", "Queue17.jpg"); chartSimpleBenchmark("Queue18", "Date", "Browse rate (messages/sec)", "Browse non-persistent messages", "Queue18.jpg"); chartSimpleBenchmark("Queue19", "Date", "Browse rate (messages/sec)", "Browse non-...
protected void doCharts() throws Exception { chartSimpleBenchmark("Queue1", "Date", "Send rate (messages/sec)", "Non transactional, Non-persistent send only of messages to queue", "Queue1.jpg"); chartSimpleBenchmark("Queue2", "Date", "Send rate (messages/sec)", ...
chartSimpleBenchmark("Topic9", "Date", "Throughput (messages/sec)", "Non-transactional, persistent send and receive with topic, one durable subscriber, AUTO_ACKNOWLEDGE", "Topic9.jpg"); chartSimpleBenchmark("Topic10", "Date", "Throughput (messages/sec)", "Transactional, persistent send and receive with topic, one dura...
chartVariableBenchmark("MessageSizeThroughput2", "messageSize", "Message size (bytes)", "Throughput (messages/sec)",
protected void doCharts() throws Exception { chartSimpleBenchmark("Queue1", "Date", "Send rate (messages/sec)", "Non transactional, Non-persistent send only of messages to queue", "Queue1.jpg"); chartSimpleBenchmark("Queue2", "Date", "Send rate (messages/sec)", ...
chartVariableBenchmark("QueueScale1", "numberOfQueues", "Number of Queues", "Throughput (messages/sec)", "Non-transactional, non-persistent send and receive with queue, varying number of queues, AUTO_ACKNOWLEDGE", "QueueScale1.jpg"); chartVariableBenchmark("QueueScale2", "numberOfConnections", "Number of sending Conne...
protected void doCharts() throws Exception { chartSimpleBenchmark("Queue1", "Date", "Send rate (messages/sec)", "Non transactional, Non-persistent send only of messages to queue", "Queue1.jpg"); chartSimpleBenchmark("Queue2", "Date", "Send rate (messages/sec)", ...
ordering = in.readLong();
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { messageID = (Serializable)in.readObject(); reliable = in.readBoolean(); expiration = in.readLong(); timestamp = in.readLong(); headers = readMap(in); redelivered = in.readBoolean(); priorit...
out.writeLong(ordering);
public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(messageID); out.writeBoolean(reliable); out.writeLong(expiration); out.writeLong(timestamp); writeMap(out, headers); out.writeBoolean(redelivered); out.writeInt(priority); out.writeInt(del...
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); InputMap ancestorMap = (InputMap)defaults.get("Table.ancestorInputMap");
InputMap ancestorMap = (InputMap) UIManager.get("Table.ancestorInputMap");
protected void installKeyboardActions() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); InputMap ancestorMap = (InputMap)defaults.get("Table.ancestorInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); // FIXME: The JDK uses a LazyActionMap for parentActionMap ActionM...
ActionMap parentActionMap = new ActionMap();
ActionMap parentActionMap = new ActionMapUIResource();
protected void installKeyboardActions() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); InputMap ancestorMap = (InputMap)defaults.get("Table.ancestorInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); // FIXME: The JDK uses a LazyActionMap for parentActionMap ActionM...
public void setSelectionInterval(int index0, int index1) { if (mode == SINGLE_SELECTION) { sel.removeAllElements(); }
public void setSelectionInterval(int index0, int index1) { sel.clear(); if (selectionMode == SINGLE_SELECTION) index0 = index1;
public void setSelectionInterval(int index0, int index1) { if (mode == SINGLE_SELECTION) { sel.removeAllElements(); } sel.addElement(new Range(index0, index1)); }
sel.addElement(new Range(index0, index1)); }
int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); sel.set(lo, hi+1); fireSelectionValueChanged(lo, hi, valueIsAdjusting); }
public void setSelectionInterval(int index0, int index1) { if (mode == SINGLE_SELECTION) { sel.removeAllElements(); } sel.addElement(new Range(index0, index1)); }
{ if (isSelectionEmpty()) return -1; boolean first = true; int min = -1; for (int i=0;i<sel.size();i++) { Range r = (Range) sel.get(i); if (first) { min = r.i0; first = false; } else { if (r.i0 > min) { min = r.i0; } } } return min; }
{ if (isSelectionEmpty()) return -1; return sel.nextSetBit(0); }
public int getMinSelectionIndex() { if (isSelectionEmpty()) return -1; boolean first = true; int min = -1; for (int i=0;i<sel.size();i++) { Range r = (Range) sel.get(i); if (first) { min = r.i0; first = false; } else { if (r.i0 > min) { min = r.i0; } } } ...
boolean first = true; int max = -1; for (int i=1;i<sel.size();i++) { Range r = (Range) sel.get(i); if (first) { max = r.i1; } else { if (r.i1 > max) { max = r.i1; } } } return max; }
int mx = -1; for(int i=sel.nextSetBit(0); i >= 0; i=sel.nextSetBit(i+1)) { mx = i; } return mx; }
public int getMaxSelectionIndex() { if (isSelectionEmpty()) return -1; boolean first = true; int max = -1; for (int i=1;i<sel.size();i++) { Range r = (Range) sel.get(i); if (first) { max = r.i1; } else { if (r.i1 > max) { max = r.i1; } } } return max; }
{ for (int i=0;i<sel.size();i++) { Range r = (Range) sel.get(i); if (r.i0 <= a && r.i1 >= a) { return true; } } return false; }
{ return sel.get(a); }
public boolean isSelectedIndex(int a) { for (int i=0;i<sel.size();i++) { Range r = (Range) sel.get(i); if (r.i0 <= a && r.i1 >= a) { return true; } } return false; }
Delivery d = topic.handle(observer, ms.reference(m), null);
MessageReference ref = ms.reference(m); Delivery d = topic.handle(observer, ref, null);
public void testDistributedTopic_1() throws Exception { jchannel2.connect("testGroup"); // allow the group time to form Thread.sleep(1000); assertTrue(jchannel.isConnected()); assertTrue(jchannel2.isConnected()); // make sure both jchannels joined the group assertEquals(2, jchann...
return super.modelToView(pos, a, b);
Shape newAlloc = adjustAllocation(a); updateMetrics(); int lineIndex = getElement().getElementIndex(pos); Rectangle rect = lineToRect(newAlloc, lineIndex); Element line = getElement().getElement(lineIndex); int lineStart = line.getStartOffset(); Segment segment = getLineBuffer(); segment.array = new char[pos - li...
public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException { return super.modelToView(pos, a, b); }
if (consumer != null)
public void setDimensions(int width, int height) { srcWidth = width; srcHeight = height; /* If either destHeight or destWidth is < 0, the image should maintain its original aspect ratio. When both are < 0, just maintain the original width and height. */ if (destWidth < 0 && destHeight < 0) { de...
if (consumer != null)
public void setPixels(int x, int y, int w, int h, ColorModel model, byte[] pixels, int offset, int scansize) { double rx = ((double) srcWidth) / destWidth; double ry = ((double) srcHeight) / destHeight; int destScansize = (int) Math.round(scansize / rx); byte[] destPixels = replicatePixels(x, y, w, h, ...
if (consumer != null)
public void setProperties(Hashtable props) { props.put("filters", "ReplicateScaleFilter"); consumer.setProperties(props); }
if (available == 0)
if ((! isBlocking()) && available == 0)
public int read (ByteBuffer dst) throws IOException { if (!isConnected()) throw new NotYetConnectedException(); byte[] data; int offset = 0; InputStream input = socket.getInputStream(); int available = input.available(); int len = dst.capacity() - dst.position(); if (available == 0) r...
if (len > available) len = available;
public int read (ByteBuffer dst) throws IOException { if (!isConnected()) throw new NotYetConnectedException(); byte[] data; int offset = 0; InputStream input = socket.getInputStream(); int available = input.available(); int len = dst.capacity() - dst.position(); if (available == 0) r...
if (log.isTraceEnabled()) { log.trace("Adding " + ref + " for channel " + channelID + (tx == null ? " non-transactionally" : " in transaction: " + tx));}
if (log.isTraceEnabled()) { log.trace("Adding message reference " + ref + " for channel " + channelID + (tx == null ? " non-transactionally" : " in transaction: " + tx));}
public void addReference(Serializable channelID, MessageReference ref, Transaction tx) throws Exception { if (log.isTraceEnabled()) { log.trace("Adding " + ref + " for channel " + channelID + (tx == null ? " non-transactionally" : " in transaction: " + tx));} Connection conn = null; PreparedStateme...
getTxId(tx), state) + " inserted " + inserted + " row(s)");
getTxId(tx), state, new Long(ref.getOrdering())) + " inserted " + inserted + " row(s)");
public void addReference(Serializable channelID, MessageReference ref, Transaction tx) throws Exception { if (log.isTraceEnabled()) { log.trace("Adding " + ref + " for channel " + channelID + (tx == null ? " non-transactionally" : " in transaction: " + tx));} Connection conn = null; PreparedStateme...
{ m = (Message)rs.getObject("PAYLOAD"); referenceCount = rs.getInt("REFERENCECOUNT"); count ++;
{ m = MessageFactory.createMessage(rs.getString(1), rs.getString(2).equals("Y"), rs.getLong(3), rs.getLong(4), rs.getInt(5), rs.getInt(6), (Map)rs.getObject(7), (Serializable)rs.getObject(8), rs.getInt(9), rs.getString(10), rs.getObject(11), rs.getString(12).equals("Y"), rs.getString(13), rs.getString(14).equals("Y"), ...
public Message retrieveMessage(Serializable messageID) throws Exception { Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; TransactionWrapper wrap = new TransactionWrapper(); try { Message m = null; int referenceCount = 0; conn ...
ps.setObject(5, ((MessageSupport)m).getHeaders()); ps.setObject(6, m);
ps.setInt(5, m.getPriority()); ps.setInt(6, m.getDeliveryCount()); ps.setObject(7, ((MessageSupport)m).getHeaders()); ps.setObject(8, m.getPayload());
public void storeMessage(Message m) throws Exception { Connection conn = null; PreparedStatement ps = null; TransactionWrapper wrap = new TransactionWrapper(); String id = (String)m.getMessageID(); try { conn = ds.getConnection(); // get the reference count fr...
int priority = -1;
public void storeMessage(Message m) throws Exception { Connection conn = null; PreparedStatement ps = null; TransactionWrapper wrap = new TransactionWrapper(); String id = (String)m.getMessageID(); try { conn = ds.getConnection(); // get the reference count fr...
priority = jbm.getJMSPriority(); try
connectionID = jbm.getConnectionID(); if (jbm.isCorrelationIDBytes()) { correlationID = jbm.getJMSCorrelationIDAsBytes(); } else
public void storeMessage(Message m) throws Exception { Connection conn = null; PreparedStatement ps = null; TransactionWrapper wrap = new TransactionWrapper(); String id = (String)m.getMessageID(); try { conn = ds.getConnection(); // get the reference count fr...
catch(JMSException e) { correlationID = jbm.getJMSCorrelationIDAsBytes(); }
public void storeMessage(Message m) throws Exception { Connection conn = null; PreparedStatement ps = null; TransactionWrapper wrap = new TransactionWrapper(); String id = (String)m.getMessageID(); try { conn = ds.getConnection(); // get the reference count fr...
ps.setInt(7, type); ps.setString(8, jmsType); ps.setInt(9, priority); ps.setObject(10, correlationID); ps.setString(11, destIsQueue ? "Y" : "N"); ps.setString(12, dest); ps.setString(13, replyToIsQueue ? "Y" : "N"); ps.setString(14, replyTo); ps.setObject(15, jmsProperties); ps.setInt(16, 1);
ps.setInt(9, type); ps.setString(10, jmsType); ps.setObject(11, correlationID); ps.setString(12, destIsQueue ? "Y" : "N"); ps.setString(13, dest); ps.setString(14, replyToIsQueue ? "Y" : "N"); ps.setString(15, replyTo); ps.setString(16, connectionID); ps.setObject(17, jmsProperties); ps.setInt(18, 1);
public void storeMessage(Message m) throws Exception { Connection conn = null; PreparedStatement ps = null; TransactionWrapper wrap = new TransactionWrapper(); String id = (String)m.getMessageID(); try { conn = ds.getConnection(); // get the reference count fr...
InlineBox prev_align, TextContent content, CascadedStyle firstLetterStyle, CascadedStyle firstLineStyle) {
InlineBox prev_align, TextContent content, CascadedStyle firstLetterStyle) {
public static InlineBox generateFirstLetterInlineBox(Context c, int start, String text, InlineBox prev_align, TextContent content, CascadedStyle firstLetterStyle, CascadedStyle firstLineStyle) { // u.p("gen first letter box"); // u.p("node = " + ...
CalculatedStyle style = content.getStyle();
c.pushStyle(firstLetterStyle); CalculatedStyle style = c.getCurrentStyle();
public static InlineBox generateFirstLetterInlineBox(Context c, int start, String text, InlineBox prev_align, TextContent content, CascadedStyle firstLetterStyle, CascadedStyle firstLineStyle) { // u.p("gen first letter box"); // u.p("node = " + ...
InlineBox box = newBox(c, content, start, end, text, prev_align, font, firstLineStyle); CalculatedStyle cs = null; if (firstLetterStyle != null) { cs = c.css.getDerivedStyle(style, firstLetterStyle); } else { cs = style; }
InlineBox box = newBox(c, content, start, end, text, prev_align, font);
public static InlineBox generateFirstLetterInlineBox(Context c, int start, String text, InlineBox prev_align, TextContent content, CascadedStyle firstLetterStyle, CascadedStyle firstLineStyle) { // u.p("gen first letter box"); // u.p("node = " + ...
styleInlineBox(c, cs, box);
styleInlineBox(c, style, box);
public static InlineBox generateFirstLetterInlineBox(Context c, int start, String text, InlineBox prev_align, TextContent content, CascadedStyle firstLetterStyle, CascadedStyle firstLineStyle) { // u.p("gen first letter box"); // u.p("node = " + ...
c.popStyle();
public static InlineBox generateFirstLetterInlineBox(Context c, int start, String text, InlineBox prev_align, TextContent content, CascadedStyle firstLetterStyle, CascadedStyle firstLineStyle) { // u.p("gen first letter box"); // u.p("node = " + ...
InlineBox box = newBox(c, content, 0, 0, null, bounds, prev_align, font, firstLineStyle);
InlineBox box = newBox(c, content, 0, 0, null, bounds, prev_align, font);
public static InlineBox generateReplacedInlineBox(Context c, Content content, int avail, InlineBox prev_align, Font font) { //u.p("generating replaced Inline Box"); // get the layout for the replaced element Layout layout = c.getLayout(content.getElement()); BlockBox block = (BlockBox) l...
public static InlineBox newBox(Context c, Content content, int start, int end, String text, InlineBox prev_align, Font font, CascadedStyle firstLineStyle) { return newBox(c, content, start, end, text, null, prev_align, font, firstLineStyle);
public static InlineBox newBox(Context c, Content content, int start, int end, String text, InlineBox prev_align, Font font) { return newBox(c, content, start, end, text, null, prev_align, font);
public static InlineBox newBox(Context c, Content content, int start, int end, String text, InlineBox prev_align, Font font, CascadedStyle firstLineStyle) { return newBox(c, content, start, end, text, null, prev_align, font, firstLineStyle); }
public static InlineBox styleBox(Context c, Node node, int start, int end, String text, Rectangle bounds, InlineBox prev_align, Font font, InlineBox box, CascadedStyle firstLineStyle) {
public static InlineBox styleBox(Context c, Node node, int start, int end, String text, Rectangle bounds, InlineBox prev_align, Font font, InlineBox box) {
public static InlineBox styleBox(Context c, Node node, int start, int end, String text, Rectangle bounds, InlineBox prev_align, Font font, InlineBox box, CascadedStyle firstLineStyle) { //u.p("styleBox node = " + node.getNodeName() + " start = " + start + " end = " + end + //" prev = " + prev + " text...
Content content = box.getContent(); CalculatedStyle style = content.getStyle(); box.setNode(node);
Content content = box.content; CalculatedStyle style = c.getCurrentStyle();
public static InlineBox styleBox(Context c, Node node, int start, int end, String text, Rectangle bounds, InlineBox prev_align, Font font, InlineBox box, CascadedStyle firstLineStyle) { //u.p("styleBox node = " + node.getNodeName() + " start = " + start + " end = " + end + //" prev = " + prev + " text...
box.setText(text);
public static InlineBox styleBox(Context c, Node node, int start, int end, String text, Rectangle bounds, InlineBox prev_align, Font font, InlineBox box, CascadedStyle firstLineStyle) { //u.p("styleBox node = " + node.getNodeName() + " start = " + start + " end = " + end + //" prev = " + prev + " text...
if (box.getText() == null) {
if (box.getMasterText() == null) {
public static InlineBox styleBox(Context c, Node node, int start, int end, String text, Rectangle bounds, InlineBox prev_align, Font font, InlineBox box, CascadedStyle firstLineStyle) { //u.p("styleBox node = " + node.getNodeName() + " start = " + start + " end = " + end + //" prev = " + prev + " text...
box.color = c.css.getStyle(node).getColor();
box.color = style.getColor();
public static InlineBox styleBox(Context c, Node node, int start, int end, String text, Rectangle bounds, InlineBox prev_align, Font font, InlineBox box, CascadedStyle firstLineStyle) { //u.p("styleBox node = " + node.getNodeName() + " start = " + start + " end = " + end + //" prev = " + prev + " text...
if (c.isFirstLine()) {
/*if (c.isFirstLine()) {
public static InlineBox styleBox(Context c, Node node, int start, int end, String text, Rectangle bounds, InlineBox prev_align, Font font, InlineBox box, CascadedStyle firstLineStyle) { //u.p("styleBox node = " + node.getNodeName() + " start = " + start + " end = " + end + //" prev = " + prev + " text...
}
}*/
public static InlineBox styleBox(Context c, Node node, int start, int end, String text, Rectangle bounds, InlineBox prev_align, Font font, InlineBox box, CascadedStyle firstLineStyle) { //u.p("styleBox node = " + node.getNodeName() + " start = " + start + " end = " + end + //" prev = " + prev + " text...
ServerProducerEndpoint(String id,
ServerProducerEndpoint(int id,
ServerProducerEndpoint(String id, Destination jmsDestination, ServerSessionEndpoint parent) { this.id = id; this.jmsDestination = jmsDestination; sessionEndpoint = parent; }
if (log.isTraceEnabled()) { log.trace("close (noop)"); } this.sessionEndpoint.producers.remove(this.id);
if (trace) { log.trace("close (noop)"); } this.sessionEndpoint.producers.remove(Integer.valueOf(this.id));
public void close() throws JMSException { if (closed) { throw new IllegalStateException("Producer is already closed"); } //Currently this does nothing if (log.isTraceEnabled()) { log.trace("close (noop)"); } this.sessionEndpoint.producers.remove(this.id); Disp...