renderer

How to change style (color, font) of a single JTree node

独自空忆成欢 提交于 2019-11-29 14:16:17
I have two JTree in two panels in a JFrame . I want to change the style(color and font) of nodes on drag and drop from one tree to the other.Please provide me a way to change the color of a JTree node permanently. To start, you will need to have a data object that can handle style and color. You could subclass DefaultMutableTreeNode and add these data items with getts and setters Then you'd need to create a custom TreeCellRenderer. I recommend extending DefaultTreeCellRenderer, and in the overridden handler, checking for your custom class, and modifying the JLabel output to use the Font and

JTable Row selection background problem.

梦想的初衷 提交于 2019-11-29 08:52:33
I have a JTable and to set a picture as background in JTable and other properties i used this code. tblMainView= new JTable(dtModel){ public Component prepareRenderer(TableCellRenderer renderer, int row, int column) { Component c = super.prepareRenderer( renderer, row, column); // We want renderer component to be transparent so background image // is visible if( c instanceof JComponent ) ((JComponent)c).setOpaque(false); return c; } ImageIcon image = new ImageIcon( "images/watermark.png" ); public void paint( Graphics g ) { // First draw the background image - tiled Dimension d = getSize();

Layout preview rendering problems in android studio(Android Studio 1.2)

我只是一个虾纸丫 提交于 2019-11-29 06:53:58
I have the following error in my preview window in the latest version of Android Studio (1.2) that stops me from being able to view the layout I am creating, I have tried restarting android studio several times as well as cleaning, rebuilding the project and restarting my computer EDIT: Some projects have the same error while other older projects work fine The following classes could not be instantiated: - android.support.v7.internal.widget.ActionBarOverlayLayout (Open Class, Show Exception, Clear Cache) Exception Details java.lang.NoClassDefFoundError: android/support/v7/internal/widget

How to render a composite component using a custom renderer?

≡放荡痞女 提交于 2019-11-28 20:58:51
I would like to know how to render a composite component, through Java, I mean I have: <myowntags:selectOneRadio> <f:selectItem itemValue="value0" itemLabel="This is the value 0" /> <f:selectItem itemValue="value1" itemLabel="This is the value 1" /> <f:selectItem itemValue="value2" itemLabel="This is the value 2" /> </myowntags:selectOneRadio> or <myowntags:selectOneRadio> <f:selectItems value="#{controller.items}" /> </myowntags:selectOneRadio> and I would like to create a Java class to render it. I know how to render a custom component without using composite, but since, to render a

3D Scene Panning in perspective projection (OpenGL)

拥有回忆 提交于 2019-11-28 19:43:37
I have designed a C++ class that abstracts the user from trackball rotation, zooming and panning. I have got the rotation (using trackball) and zooming working as expected. However, panning does not behave as expected. When I pick a point and drag, I expect that on finishing drag, the picked point continues to be under the mouse. My understanding of panning in perspective projection is as follows. The target and the camera position, both will be affected by a pan operation. The camera target and the camera position (eye) should be translated proportional to the drag. The proportionality (may

Custom TableCellRenderer/TreeTableCellRenderer doesn't render Table cells

六眼飞鱼酱① 提交于 2019-11-28 11:30:28
I made this CustomCellRenderer class intended to be used in JXTreeTable and JXTable objects since I have many of these in my project. So this class implements TreeCellRenderer and TableCellRenderer interfaces: public class CustomCellRenderer extends JLabel implements TreeCellRenderer, TableCellRenderer { @Override public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { setBackground(selected ? new Color(83,142,213) : Color.white); setForeground(selected ? Color.white : Color.black); //here is the

JFreeChart different colors in different regions for the same dataSeries

会有一股神秘感。 提交于 2019-11-28 10:30:23
In JFreeChart I'm trying to color different regions of an XY line chart/curve based on y value. I'm overriding the XYLineAndShapeRenderer 's getItemPaint(int row, int col) , however I'm not sure how it handles the coloring of the line between the x s since it's only getting itemPaint on the x (integer values). final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer() { @Override @Override public Paint getItemPaint(int row, int col) { System.out.println(col+","+dataset.getY(row, col)); double y=dataset.getYValue(row, col); if(y<=3)return ColorUtil.hex2Rgb("#7DD2F7"); if(y<=4)return

Layout preview rendering problems in android studio(Android Studio 1.2)

蓝咒 提交于 2019-11-28 00:23:27
问题 I have the following error in my preview window in the latest version of Android Studio (1.2) that stops me from being able to view the layout I am creating, I have tried restarting android studio several times as well as cleaning, rebuilding the project and restarting my computer EDIT: Some projects have the same error while other older projects work fine The following classes could not be instantiated: - android.support.v7.internal.widget.ActionBarOverlayLayout (Open Class, Show Exception,

How can I find the maximum texture size for different phones?

回眸只為那壹抹淺笑 提交于 2019-11-27 21:22:30
I'm trying to find out the maximum texture size for the original Motorola Droid. I believe the G1 has a maximum texture size of 512, but it would be nice if there was a more official way I could find out so I can build a proper tile system. You can request the max texture size using glGetIntegerv: int[] maxTextureSize = new int[1]; gl.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxTextureSize, 0); Log.i("glinfo", "Max texture size = " + maxTextureSize[0]); Also check out http://www.glbenchmark.com/ - it has an extensive database of OpenGL environment and performance details for mobile devices 来源:

How to render a composite component using a custom renderer?

与世无争的帅哥 提交于 2019-11-27 21:04:31
问题 I would like to know how to render a composite component, through Java, I mean I have: <myowntags:selectOneRadio> <f:selectItem itemValue="value0" itemLabel="This is the value 0" /> <f:selectItem itemValue="value1" itemLabel="This is the value 1" /> <f:selectItem itemValue="value2" itemLabel="This is the value 2" /> </myowntags:selectOneRadio> or <myowntags:selectOneRadio> <f:selectItems value="#{controller.items}" /> </myowntags:selectOneRadio> and I would like to create a Java class to