composite

SWT ScrolledComposite cutting off information.

若如初见. 提交于 2019-12-20 01:45:50
问题 I'm making an application that has many lines of data coming back from a Database stub(which will become an Oracle database), and for some reason the scroll bar stops at about the 500th element. I'm wondering if there's anyway to have all the elements show within the scroll bar. 回答1: I'm assuming here that you're using Windows, because there is a fairly general problem with scrollbars on Windows: the maximum value is a short int, 32,768. Therefore, if the height of the inner composite of a

When should I use composite design pattern?

和自甴很熟 提交于 2019-12-18 10:01:55
问题 I don't understand when I should use composite design pattern . What kinds of benefits will I get from this design pattern? I visited this website but it only tells me about the structure of the design pattern and not the scenarios in which it is used. I hope that it will be beneficial to the programmers like me who are starting to learn design pattern. 回答1: Quoting from Design Patterns, Use the Composite pattern when you want to represent part-whole hierarchies of objects. you want clients

WPF, Prism v2, Region in a modal dialog, add region in code behind

∥☆過路亽.° 提交于 2019-12-17 18:55:26
问题 I have a composite WPF application. In one of my modules I want to make a wizard and have the steps show up in a region so I can switch between the steps easier. Originally I had this wizard showing up in a tab region and the nested region worked fine. Now I want to make it into a modal dialog box, but after I open it the inner region never gets registared with the region manager; So I can't add my wizard steps. I was under the impression that the region manager was global, and just adding

Canvas - Fill a rectangle in all areas that are fully transparent

给你一囗甜甜゛ 提交于 2019-12-17 18:47:14
问题 I'm writing a simple 2D game engine using the HTML5 canvas. I've come to adding a lighting engine. Each light source has a radius value and an intensity value (0-1, eg 1 would be very bright). There's also an ambient light value that is used to light everything else in the world that isn't near a light source (0-1, eg 0.1 would be moonlight). The process of lighting is done on a separate canvas above the main canvas: For each light source, a radial gradient is drawn at that position with the

How do I associate a keypress with a DelegateCommand in Composite WPF?

感情迁移 提交于 2019-12-17 16:08:08
问题 I am building a composite application using CAL/Prism. The main region is a tab control, with multiple types of views in it. Each view has a custom set commands that it can handle which are bound to toolbar buttons at the top of the window. I've done this before in non-CAL apps by simply setting the InputBinding on the command, but I haven't been able to find any such mechanism in the source code for the CAL modules. My question is, what is the best way to hook up a keystroke to my view, so

“Screen” effect in Java 2D graphics

狂风中的少年 提交于 2019-12-14 01:21:29
问题 This is a question that's been bugging me for some time now: In photoshop/GIMP, there is a "screen" layer composition mode. This mode has bright colours have a strong alpha, and dark colours a weak one. Black is entirely transparent, white entirely opaque. I would dearly love to be able to replicate this composite using Java 2D graphics, but my repeated attempts at trying to coax AlphaComposite into this have failed - and indeed I think this is outside of AlphaComposite's capabilities. A

GWT composite widget

守給你的承諾、 提交于 2019-12-13 04:59:35
问题 I try to build own GWT widget. I select the composite way of build it. But I have problem, the widget didn't see on screen. Here is the composite widget code: public class LoginPanel extends Composite { private static final String DEFAULT_STYLENAME = "LoginPanel"; private TextBox nameField; private PasswordTextBox passField; private Button loginButton; private Label errorLbl; private DecoratedPopupPanel decoratedPopupPanel; public LoginPanel() { nameField = new TextBox(); passField = new

Composite Pattern

和自甴很熟 提交于 2019-12-13 03:30:01
问题 I have question regarding composite pattern. Is the base class "Component" act like a pointer to point leaf object in "Composite" class? Edit: Let me ask my question in following words. "What is the relation between Composite and Component class?" Here is the uml class diagram of the pattern. 回答1: Relation between composite and component: 1) Leaf and Composite usually implement one interface or one abstract class. In your diagram they extend Component. So, the relation on your diagram is

How to dispose all children of Composite object?

不羁的心 提交于 2019-12-13 02:57:29
问题 I hava a Composite descComp with some stuff in it... basically it is a container for a form, consisting of number of labels, Combos and buttons, all aligned in a line. My form is not finite, I have a button that adds one extra line for extra input. However for that to work it seams I have to dispose old children of my descComp... private void populateConstantMain(ContentData tariffConstantsOfType, Composite descComp,GridLayout descCompLayout, Boolean resize) { int arraySize; if (resize ==

JSF2 Composite component link using ajax

懵懂的女人 提交于 2019-12-13 02:27:53
问题 Here is my (simplified) issue : I've got a page that is using 2 composite components of mine : - CCSelection - CCDisplay In CCSelection, I have a list of values, each one has got a h:commandLink onto. When clicking on a link, the CCDiaplay component is refreshed using the selected value. To do this, CCSelection exposes a method attribute that is directly linked on each h:commandLink. The value is given to the method using f:attribute. In the page backing bean, I've got a method (that is given