renderer

Align text in a JTable cell while maintaining JTable default renderer?

邮差的信 提交于 2019-12-04 17:18:34
I have a JTable that does lovely alternations in coloration thanks to this code: table.setDefaultRenderer(Object.class, new BorderRenderer(new ColorRenderer(table .getDefaultRenderer(Object.class), colorProvider))); (Here the "colorProvider" contains code that turns every other row light grey.) I have one column in which I would like to align text to center. If I simply set a DefaultCellRenderer on that column with center horizontal alignment, it overrides the table's default renderer and I lose my lovely stripes. Can I keep the stripes and still change the alignment of a column? To further

Using renderDataTable within renderUi in Shiny

筅森魡賤 提交于 2019-12-04 10:36:40
问题 I'm experimenting a Shiny App to show dynamic contexts, but I cannot get renderDataTable working into a renderUi component. Below two simple replicable tests: the first one is not working, the second one without renderUi works fine, of course. What is the conceptually difference between this two, and why the first one cannot work in Shiny ? This one not works: note that the uiOutput myTable , contains two reactive component, a selectInput and a renderDataTable , but only the selectInput is

JavaFX 8 QuantumRenderer high CPU usage

╄→尐↘猪︶ㄣ 提交于 2019-12-04 10:22:12
问题 I have a JavaFX APP containing two listviews displaying incoming customer orders (using a custom cellfactory) received from my server. I also have a few tableview displaying information from a Postgres database (this are spread across a few tabs inside a tabpane). The user has to take an order (by clicking on it), and enter a few information inside textboxes. The application was initially written an deployed using Java7. I had no problem whatsoever. But recently I decided to switch to Java8.

How to render an image to a JTable cell

江枫思渺然 提交于 2019-12-04 04:42:30
问题 I want to apply a renderer on a cell of my JTable, to do so I created a class named myRenderer : import java.awt.Component; import javax.swing.ImageIcon; import javax.swing.JTable; import javax.swing.table.DefaultTableCellRenderer; public class MyRenderer extends DefaultTableCellRenderer { public Component getTableCellRendererComponent(JTable table, ImageIcon icon) { setIcon(icon); return this; } } And I use this piece of code to apply the renderer on the cell : MyRenderer renderer = new

changing how Nimbus LaF handles JTree node highlighting

纵饮孤独 提交于 2019-12-04 04:16:10
I have been working to transition a Java application from WindowsLookAndFeel to Nimbus, largely successfully, despite Nimbus foibles. My users overall like the Nimbus LaF but didn't like some details, some of which I changed by consulting previous questions on this site. Example: I copied the LeafIcon, ClosedIcon and OpenIcon from Windows LaF (which they liked) and use them in the Nimbus version, for a nice combination of LaFs. Stuck on one last (?) problem. I have a JTree with a subclassed DefaultCellRenderer to create the appropriate node displays. This works fine under WindowsLookAndFeel.

How to change the color of particular cell in JXTreeTable dynamically

邮差的信 提交于 2019-12-04 02:17:53
问题 I am using JXTreeTable for making treetable structure now I want to change the color of specific cell dynamically. How can I change the color of cell? I found this code to change the color, but this is not working. Here is Code: leftTree.setDefaultRenderer(Object.class, new DefaultTableCellRenderer() { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Component c = super.getTableCellRendererComponent(table,

IE9 does not at all care about 'X-UA-Compatible' meta tag

为君一笑 提交于 2019-12-03 21:55:38
I can't find anything about this on the internet, so I'm looking for help here: For some technical reasons I try to force IE9 into IE8 rendering mode, using the following meta tag as the first line right after <head> : <meta content="IE=8" http-equiv="X-UA-Compatible"> For some reason all the IE9s in our office just render IE9 style, no matter what I try. When I look into the DevTool (F12) from IE9, it shows me that IE8 is the "page default", but it still sticks to the rendering mode set in the DevTools. There is no way to influence that. We even did a delete and re-install of IE9, because we

Compound JTree Node allowing events to pass through to objects underneath

谁说胖子不能爱 提交于 2019-12-03 20:22:05
问题 I'm trying to create a JTree in which some nodes are compound objects containing a JLabel and a JButton. The Node is representing a server and port shown by the JLabel, the JButton will use the Desktop API to open the default browser and go to the URL. I have read the following already and have followed them as closely as I can. The Node is displayed how I want it (mostly - I can deal with making it nicer later) but when I try to click on the button the JTree is responding to the events, not

Rails Custom Renderer

落爺英雄遲暮 提交于 2019-12-03 17:20:01
I've been trying to create a custom renderer based on this Yehuda Katz's blog post . It works if I call render :my_custom_renderer => "index" , but it doesn't work with default respond_with or format.my_custom_renderer I created a simple example, . From a blank app, add the following lines: In config/mime_types.rb: Mime::Type.register_alias 'text/html', :my_custom_renderer In config/my_custom_renderer.rb: require "action_controller/metal/renderers" ActionController.add_renderer :my_custom_renderer do |template, options| self.mime_type ||= Mime::HTML self.response_body = render_to_string

Circle approximations using Bezier curves

狂风中的少年 提交于 2019-12-03 16:46:56
I have 2 questions about bezier curves, and using them to approximate portions of circles. Given the unit circle arc (1,0)->(cos(a),sin(a)) where 0 < a < pi/2, will it result in a good approximation of this arc to find the bezier curve's control points p1, p2 by solving the equations imposed by the requirements B(1/3) = (cos(a/3), sin(a/3)) and B(2/3) = (cos(2a/3), sin(2a/3)). (In other words, requiring that the bezier curve go through two evenly spaced points in the arc). If we have an affine transformation A which turns the circle arc in an ellipse arc will the transformed control points Ap0